1. Architecture and main protocols of TCP/IP protocol family
The TCP/IP protocol family is a layer-4 protocol system.
Data link layer: implements network drivers for Nic interfaces to process data transmission on physical media (such as Ethernet and Token network. The two common protocols on the data link layer are ARP (Address Resolve Protocol) and RARP (revers address resovle protocol ). Converts IP addresses to physical addresses.
Network Layer: select and forward data packets. The network layer has two major protocols: the IP protocol (Internet Protocol) and the ICMP protocol (Internet Control Message Protocol). The IP protocol is the core.
Transport Layer: Provides end-to-end communication for applications on two hosts. The transport layer has three main Protocols: TCP, UDP, and sctp.
Application Layer: responsible for processing application logic. The application layer is mainly implemented in user space and is responsible for processing a large number of logics, such as file, name query, and network management.
Ii. Encapsulation
Before an application is sent to a physical network, it is transmitted from top to bottom along the protocol stack.
The data encapsulated by TCP is called a TCP packet segment. There are also UDP datagram and IP datagram. The data encapsulated by the data link layer is called a frame ).
An Ethernet frame uses a 6-byte physical address and a 6-byte source physical address to represent both Parties to the communication.
Frames are the sequence of bytes that are finally transmitted over the physical network.
Iii. Sub-Use
When the frame arrives at the target host, it is transferred from the bottom to the top of the protocol stack. The use of this function depends on the Type field in the header information.
The IP protocol, ARP protocol, and RARP protocol are both frame transmission data. The header of the frame needs fields to distinguish them. For example, the value of the Ethernet frame field type is:
0x8000, the data part of the frame is IP datagram, And the Ethernet Program delivers the frame to the IP module.
0x806 indicates the ARP request or response packet.
0x835, which is the RARP request or response program.
After the frame is used, the original data before encapsulation is finally sent to the target service.
Iv. Port
Well-known ports: from 0 to 1023, which are allocated and controlled by IANA and bound to some services.
Registered ports (registered ports): from 1024 to 49151. These ports are not controlled by IANA, but are registered by IANA and provide a usage list. For example, 1433 Microsoft SQL server port.
Dynamic or private ports: From 49152 to 65535. iana regardless of these ports.
TCP/IP BASICS (1)