The Concept of OSI: Open System Interconnect is a reference model defined by ISO (International Organization for Standardization). It is a flexible, robust, and interoperable model, not a protocol, commonly used to analyze and design network architecture.
The OSI model is divided into seven layers: OSI divides the network into seven layers, from bottom to top: Physical Layer, Data Link Layer, Network Layer, Transport Layer, Session Layer, Presentation Layer, Application Layer.
In the TCP/IP protocol suite, the Data Link Layer serves three main purposes:
1) To send and receive data for the IP module
2) To send ARP requests and receive ARP replies for the ARP module
3) To send RARP requests and receive RARP replies for the RARP module
TCP/IP supports various Data Link Layer protocols, depending on the hardware used in the network, such as Ethernet, Token Ring, FDDI (Fiber Distributed Data Interface), and RS-232 serial lines.
The most commonly used encapsulation format is the Ethernet frame format defined by RFC894.
The frame format uses a 48-bit (6-byte) destination address and source address.
Definitions of Each OSI Layer:
Characteristics: 1. Each layer of the OSI model has its own set of functions;
2. Layers are independent yet rely on each other;
3. Upper layers depend on lower layers, and lower layers provide services for upper layers.
The Functions and Analysis of Each Layer
Application Layer |
Provides an interface for application software, allowing applications to use network services; for example: http(80), ftp(20/21), smtp(25), pop3(110), telnet(23), dns(53), etc. |
Presentation Layer |
Decoding and encoding of data; data encryption and decryption; data compression and decompression; for example: ASCII JPEG |
Session Layer |
Responsible for establishing, managing, and terminating sessions between Presentation Layer entities, providing session control between devices or nodes; coordinates the communication process between systems and offers three different methods to organize communication: simplex, half-duplex, and full-duplex. |
Transport Layer |
Responsible for establishing end-to-end connections, ensuring message transmission between endpoints; service point addressing, segmentation and reassembly, connection control, flow control, and error control. |
Network Layer |
Provides logical addressing for network devices (Layer 3 addressing); performs routing, maintains routing tables; responsible for transmitting packet data from the source to the destination. For example: 1. Broadcast and multicast isolation 2. Addressing and forwarding to select the best path to the destination network 3. Traffic management 4. Connecting to Wide Area Networks (WAN) |
Data Link Layer |
Provides reliable data transmission services over unreliable physical links, moving frames from one hop (node) to another. Framing, physical addressing, flow control, error control, and access control. For example: The Data Link Layer includes: MAC (802.3) and LLC sublayer (802.2). |
Physical Layer |
Responsible for moving individual bits from one hop (node) to another. Functions of the Physical Layer: 1. Defines physical characteristics of interfaces and media 2. Defines bit representation, data transmission rates, and signal transmission modes (simplex, half-duplex, full-duplex) 3. Defines network physical topologies (mesh, star, ring, bus, etc.) |
Differences Between OSI and TCP/IP
1. TCP/IP supports cross-layer encapsulation; OSI does not.
2. TCP/IP only supports the IP network protocol; OSI supports multiple network layer protocols (IP, IPX, APPLE TALK, NOVELL, NSAP).
TCP: Connection-oriented, reliable transport protocol.
UDP: Connectionless, unreliable transport protocol; unordered delivery.
Routing Layer: AD Metric
Data Layer: Operations, longest match, recursive lookup
show run | include ip route show run | section ip route
3.. TCP/UDP
Connection-oriented (a confirmation action before initial communication): TCP three-way handshake (ensures connection-oriented).
Four-way teardown: 1. TCP packet with FIN=1, 2. ACK, 3. Opposite side sends TCP packet with FIN=1 + previous ACK, 4. ACK.
During the three-way handshake and four-way teardown, each time consumes a sequence number.
Reliable transmission: 1. Acknowledgment mechanism 2. Retransmission 3. Reordering.
UDP: No ACK, no sequence.
Disadvantages of UDP: 1. No error avoidance mechanism (can receive duplicate packets) 2. No flow control 3. Unordered delivery 4. No acknowledgment mechanism.
IP packets: IPv4, IPv6
IPv4 header is variable, minimum 20 bytes, maximum 60 bytes.
TOS field: Used to specify special packet processing methods. Divided into two subfields: priority and TOS, priority is used to set the priority of the packet (can be used in QoS); TOS allows selection of transmission services based on throughput, latency, reliability, and cost; TOS field is not commonly used, usually set to all 0s.
ARP: Address Resolution Protocol, encapsulated based on Layer 2 — encapsulated in data frames.
AARP: Forward ARP.
RARR: Reverse ARP.
InARP: Inverse ARP, used in Frame Relay.
G-ARP: Gratuitous ARP, used for address conflict detection.
Proxy-ARP: Proxy ARP; proxy — not on the same subnet will proxy.
Private IP addresses:
10.0.0.0/8 172.16.0.0—172.31.255.255 192.168.0.0—192.168.255.255
Data Transmission Process
Data Encapsulation Process
Decapsulation Process
Supplement: Ping (ICMP), traceroute, debug, and other tools for troubleshooting.
Ping is an application that tests network layer connectivity (simulating bidirectional communication at the network layer).
Purpose: To test the connectivity of the network layer (simulating bidirectional communication at the network layer).
Working Principle: 1. Send ICMP echo request.
2. ICMP is encapsulated by IP; intermediate network devices see an IP packet.
3. The target host receives the echo request and sends an echo reply.