Network Reference Model
Network Reference Model
They ensure interoperability and proper data flow between devices, with
each layer of the network model using Packet Data Units (PDUs).
ISO: Created the OSI model, a key reference for networking standards.
Transport Layer:
Network Layer:
4. OSI Model
The Seven Layers of the OSI Model:
1. Physical Layer:
Responsible for the transmission of raw bitstreams (0s and 1s) over a
physical medium like cables, fiber optics, or wireless.
Encapsulates data packets into frames and controls how data is placed
onto the physical medium.
3. Network Layer:
4. Transport Layer:
5. Session Layer:
6. Presentation Layer:
Translates data formats so that the application layer of one system can
understand the data from another system.
7. Application Layer:
The layer closest to the end user, providing network services directly to
applications (e.g., web browsers, email clients).
Combines the physical and data link layers of the OSI model.
2. Internet Layer:
Combines the transport layer functions from the OSI model, ensuring
reliable communication between devices.
4. Application Layer:
The TCP/IP model is more widely used due to its direct relevance to Internet
protocols like TCP and IP.
The OSI model separates network functions in detail, which is useful for
understanding specific aspects of network communication, but the TCP/IP
model simplifies this into fewer layers.
Communication Structure:
FTP Server: The server hosts files and manages client access. It listens
for incoming client connections, authenticates users, and provides
access to stored files.
Ports: FTP uses TCP ports 20 (data transfer) and 21 (control commands).
ii. Telnet
Structure:
Usage: Telnet is useful for managing network devices like routers and
switches, but its use is limited today due to security concerns.
Ports: HTTP typically uses TCP port 80. HTTPS operates on TCP port 443.
PDU: At the transport layer, PDUs are called segments (for TCP) or
datagrams (for UDP).
Reliable: TCP ensures that all segments are delivered in sequence and
without errors using acknowledgments and retransmission mechanisms.
Header Details:
Source Port (16 bits): The port number of the application sending the
segment.
Destination Port (16 bits): The port number of the application receiving
the segment.
Sequence Number (32 bits): Used to keep track of data byte order.
Control Bits (Flags): Includes SYN, ACK, FIN, etc., to manage the state
of the connection.
Window Size (16 bits): Controls flow by specifying how much data the
receiver can accept.
Urgent Pointer (16 bits): Indicates urgent data if the URG flag is set.
Header Details:
Destination Port (16 bits): The port number of the application receiving
the datagram.
Length (16 bits): The total length of the UDP header and data.
Client → Server: The client sends a TCP segment with the SYN flag set.
This segment indicates that the client wants to establish a connection
and begins the process.
Server → Client: The server receives the SYN packet, acknowledges it,
and responds with a TCP segment that has both the SYN and ACK flags
set.
Client → Server: After receiving the SYN-ACK packet, the client sends a
final ACK packet to the server.
1. Window Initialization:
During the TCP handshake, both the sender and receiver negotiate the
window size.
The receiver specifies the maximum number of bytes it can receive and
store in its buffer at one time.
The receiver stores incoming data in its buffer and updates the window
size as it processes the data.
1. FIN from PC1: The client sends a segment with the FIN flag, indicating it
wants to terminate the connection.
2. ACK from PC2: The server acknowledges the FIN with an ACK segment.
3. Data Check and FIN from PC2: If the server has remaining data, it sends it
and then sends a FIN segment. Otherwise, it directly sends the FIN
segment.
4. ACK from PC1: The client acknowledges the FIN, and the connection is
closed.
This four-step process ensures that both sides properly close the connection
and release resources.
PDU: At the network layer, the Protocol Data Units (PDUs) are called
packets.
IP addresses help identify both the source and the destination of each
packet, allowing for communication across different networks.
The network layer determines the best path for packets to travel from
the source to the destination using routing protocols and routing
tables.
Routers, the devices that operate at this layer, read the destination
address of packets and consult their routing tables to forward packets
toward the destination.
3. Forwarding:
Routing Tables: Routers maintain routing tables, which are essentially maps
that determine the best path for packets to reach their destination. Routing
tables are populated using routing protocols
When the network layer receives data from the transport layer (e.g., a
TCP segment or UDP datagram), it encapsulates this data into an IP
packet.
2. Packet Forwarding:
Each router the packet encounters along its path reads the destination
IP address and checks its routing table for the best match.
Based on the routing table entry, the router forwards the packet to the
next hop (another router or the final destination).
When the packet arrives at the destination host, the network layer
checks if the destination IP matches its own. If it matches, the packet is
passed up to the transport layer for further processing.
PDU (Protocol Data Unit): At the data link layer, PDUs are called frames.
The data link layer encapsulates network layer packets into frames.
2. Physical Addressing:
Unlike the network layer, which uses IP addresses, the data link layer
uses MAC (Media Access Control) addresses to identify devices on
the same network segment.
3. Error Control:
Before sending a frame, a device (e.g., Host 1) checks its ARP table to
see if it already has the MAC address corresponding to the destination
IP address.
If the MAC address is found in the ARP table, the device uses it to send
the frame. If not, the device initiates an ARP request.
If the destination MAC address is not in the ARP table, the device sends
an ARP request. This is a broadcast message sent to all devices within
the network segment.
Each device that receives the ARP request checks whether the target IP
address matches its own IP address.
If the IP address matches (e.g., Host 2), the device records the sender's
(Host 1’s) MAC and IP addresses in its ARP table and prepares an ARP
The switch forwards the ARP reply only to Host 1 based on the MAC
address of Host 1 contained in the frame.
Upon receiving the ARP reply, Host 1 updates its ARP table with the
MAC address of Host 2.
Host 1 now has the MAC address associated with Host 2’s IP address
and can encapsulate this MAC address in the frame header for data
transmission.
ARP Cache
ARP Table: Devices maintain an ARP cache to store IP-to-MAC address
mappings temporarily. This cache helps reduce network traffic by
preventing the need for frequent ARP requests.
Expiration: ARP entries have a validity period (usually around 180 seconds).
After this period, entries are removed, and a new ARP request is necessary
if the device needs to communicate again.
PDU (Protocol Data Unit): At the physical layer, the PDUs are called
bitstreams.
Optical Fibers:
Serial Cables:
Wireless Signals:
For example, when you access a website, the data (HTML page) is
encapsulated with HTTP, TCP, IP, and Ethernet headers before being
transmitted over the network. At the receiving end, these headers are removed
(decapsulated) layer by layer until the web page data is delivered to your
browser.