5. Network model - Hacck3y/Networking-Basic-to-Advance GitHub Wiki
Networking model categorize and provides a structure for networking protocols and structure.
What is protocols? A set of rules (logical rules not physical) defining how network device and software should work.
Network without standardization : If del make of networking model and i mac own so they can't communicate to each other.
- OSI model : used for research purpose
- TCP/IP mode : develop to meet the need of internet design. HTTP, FTP, TCP, IP these are the protocol used on respective layers.
Routing : is process of sending a ip packet from one network to another network it not down in local network. Routing is done because ARP can't provide mac address of another device because its not in same network. if device is in same network ARP Request is sent.
OSI stand for Open system interconnection model. OSI model created by international organization for standardization (ISO) IN later 17es.
Encapsulation : The data is processed through the OSI stack from top to bottom , each layer adding something to original data this is called Encapsulation.
De-Encapsulation : As the additional information is removed as the data is processed bottom to up the stack is called De-Encapsulation.
- Layer 1: Physical – Transmits raw bits
- Layer 2: Data Link – Frames and error detection
- Layer 3: Network – Routing and addressing
- Layer 4: Transport – End-to-end communication
- Layer 5: Session – Managing sessions
- Layer 6: Presentation – Data translation and encryption
- Layer 7: Application – User interface and application services
Let's discuss all one by one.
7. Application
- This is closes to end user.
- Interacts with software applications
- HTTP , HTTPS , FTP, IRC, SSH, DNS are Layer 7 Protocols.
The communication between the application layer of the two different system is called Same layer interaction.
6. Presentation
- In short, The presentation layer translates data to appropriate format.
- Data in the application layer is in
application format.It need to betranslatedto a different format to be send over the network. - The presentation layer job is to translate between application and network formats.
- EX: encryption of data as it is send, and decryption of data as it is received.
- Session
- control dialogues (sessions) between communicating hosts.
- Establish, manage and terminate connection between local application and the remote application.
• Network engineers don't usually work with the top 3 layers. • Application developers work with the top layers of the OSI model to connect their applications over networks.
- Transport
- Segments and reassembles data for communications between end hosts.
- Breaks large pieces of data into smaller segments which can be more easily sent over the network and are less likely to cause transmission problems if errors occur.
Provide host-to-host communication.
Functions: it manage Flow control , error control , sizing the packets.
- Network
- Provides connectivity between end hosts on different networks (ie. outside of the LAN).
- Provides logical addressing (IP addresses).
- Provides path selection between source and destination.
- Routers operate at Layer 3.
Function : Logical addressing , routing , path determination.
- Data Link
- Provides node -to -node connectivity and data transfer (for example, PC to switch, switch to router, router to router).
- Defines how data is formatted for transmission over a physical medium (for example, copper UTP cables)
- Detects and (possibly) corrects Physical Layer errors.
- Uses Layer 2 addressing, separate from Layer 3 addressing.
- physical
- Defines physical characteristics of the medium used to transfer data between devices. For example, voltage (eve(S) maximum transmission distances, physical connectors, cable specifications, etc.
- Digital bits are converted into electrical (for wired connections) or radio (for wireless connections) signals.
- Data or payload or packet (all is same) = is created by top 3 layer.
- L4 header = Layer 4 header is called Segment. Segment is a term for L4 PDU.
- L3 header = Layer 3 header is called packet. Packet is a term for L3 PDU.
- After adding L2 as well whole it is called FRAME. this Frame is sent through cables to other system and then De-Encapsulated.


Cyberattacks On The OSI Layers
| LAYERS | USE | Attacks | |
|---|---|---|---|
| APPLICATION | end user layer http, ftp, irc, ssh, dns |
EXPLOIT | host layers |
| PRESENTAION | syntax layer SSL , SSH, IMAP, FTP, JPEG |
PHISHING | host layers |
| SESSION | synch & send to port API, sockets, winSock |
HIJACKING | host layers |
| TRANSPORT | end to end connection TCP, UDP |
RECONNAISSANCE, DOS |
medium layers |
| NETWORK | packet IP, ICMP, IPSec, IFMP |
MITM | medium layers |
| DATA LINK | FRAMS Ethernet, PPP, Switch, Bridge |
SPOOFIND | medium layers |
| PHYSICAL | Physical structure Coax, Fiber, Wireless, Hubs, Repeaters |
SNIFFING | medium layers |
| Layer | Use | Attacks | Attack Controls |
|---|---|---|---|
| Layer 1: Physical Layer | Transmission of raw bits over physical mediums | Eavesdropping, Signal Jamming | Encryption, Shielding, Physical Security |
| Layer 2: Data Link Layer | Error detection, framing, MAC address communication | MAC Spoofing, ARP Spoofing | MAC Filtering, Port Security, ARP Spoofing Detection |
| Layer 3: Network Layer | Routing and logical addressing | IP Spoofing, ICMP Attacks (e.g., Ping Flood, Smurf Attack) | Access Control Lists (ACLs), IP Spoofing Prevention, ICMP Rate Limiting |
| Layer 4: Transport Layer | Reliable data transfer between devices | DDoS Attacks, SYN Flooding | Load Balancing, SYN Cookies, Rate Limiting |
| Layer 5: Session Layer | Establishing, maintaining, and terminating connections | Session Hijacking, Man-in-the-Middle (MitM) Attacks | Encryption (e.g., HTTPS), Digital Signatures, SSL/TLS |
| Layer 6: Presentation Layer | Data formatting, compression, and encryption | Malicious Code Execution, Data Injection | Data Validation, Encryption, Input Validation |
| Layer 7: Application Layer | Facilitating user interactions with applications | Cross-Site Scripting (XSS), SQL Injection | Input Sanitization, Web Application Firewalls (WAFs), Regular Security Audits |
- TCP/IP Model: A framework for the communication protocols used in the Internet and various networks.
- Known as TCP/IP because those are two of the foundation protocols in the suite.
- Development: Created by the U.S. Department of Defense through DARPA (Defense Advanced Research Projects Agency). and OSI is created by ISO.
- Layer Structure: Similar to the OSI model but with fewer layers.
- Current Use: The primary model in modern networking.
- Influence: The OSI model still shapes discussions and practices among network engineers.
https://www.youtube.com/watch?v=2QGgEk20RXM
HTTP, FTP, TCP, IP these are the protocol used on respective layers.



- this chat show if their is 2 host A,B and 2 Router Between then so how data is Transport to A TO B.

OSI and TCP/IP both are logical models. One of the main similarities between the OSI and TCP/IP models is that they both describe how information is transmitted between two devices across a network. Both models define a set of layers. Each layer performs a specific set of functions to enable the transmission of data.
Real-World Application:
- The TCP/IP model is widely used in practical networking and forms the basis for the Internet.
- The OSI model serves as a theoretical guide but is less commonly implemented in its entirety.
Protocol Specification:
- OSI Model: Does not prescribe specific protocols; it provides a framework for different protocols to operate within each layer.
-
TCP/IP Model: Includes specific protocols defined for each layer, such as:
- Application Layer: HTTP, FTP, SMTP
- Transport Layer: TCP, UDP
- Internet Layer: IP (IPv4, IPv6)
| Parameters | OSI Model | TCP/IP Model |
|---|---|---|
| Full Form | OSI stands for Open Systems Interconnection | TCP/IP stands for Transmission Control Protocol/Internet Protocol |
| Layers | It has 7 layers | It has 4 layers |
| Usage | It is low in usage | It is mostly used |
| Approach | It is vertically approached | It is horizontally approached |
| Delivery | Delivery of the package is guaranteed in OSI Model | Delivery of the package is not guaranteed in TCP/IP Model |
| Replacement | Replacement of tools and changes can easily be done in this model | Replacing the tools is not easy as it is in OSI Model |
| Reliability | It is less reliable than TCP/IP Model | It is more reliable than OSI Model |
| Protocol Example | Not tied to specific protocols, but examples include HTTP (Application), SSL/TLS (Presentation), TCP (Transport), IP (Network), Ethernet (Data Link) | HTTP, FTP, TCP, UDP, IP, Ethernet |
| Error Handling | Built into Data Link and Transport layers | Built into protocols like TCP |
| Connection Orientation | Both connection-oriented (TCP) and connectionless (UDP) protocols are covered at the Transport layer | TCP (connection-oriented), UDP (connectionless) |