Data forwarding process


Data communication process:

1. Data encapsulation process: convert data to binary numbers (0 and 1)

2. Data transmission process: forwarding through media and network equipment

3. Data unpacking process: convert binary numbers into data

1. Data encapsulation process: convert data into binary numbers

Reference model: TCP / IP reference model

osi reference model






OSI reference model:

Application layer: generate data ———– PDU protocol data unit

Http: Hypertext Transfer Protocol ——— 80 TCP

FTP: File Transfer Protocol ———— 20 21tcp

DNS: domain name resolution protocol ————- 53tcp or UDP

DHCP: Dynamic Host Configuration Protocol —— 67 68udp

Telnet: remote login protocol ————- 23tcp

SSH: Secure Remote Login Protocol ——— 22tcp

POP3: post office protocol ————————– 110tcp

SMTP protocol: Simple Mail Transfer Protocol —- 25tcp

Qicq: QQ protocol ———————– UDP member 4000 UDP non member 8000 tcp443


Because different applications will produce different data and different data have different requirements during transmission, different protocols should be encapsulated in the transmission layer.

Function of port number: used to identify the application layer protocol

Port number: 65536 0 — 65536

Well known port number: 0 — 1023 reserved for the network

Registered port number: commercial 1024 — 49151

Random port number: 49152 — 65535

Layer 4: —————- data segment

Function: data segmentation. 1500 bytes by default

Encapsulate TCP or UDP header message

TCP: Transmission Control Protocol

  TCP 49155—->80|http-date

Advantages: reliable transmission; disadvantages: slow transmission

How does TCP ensure reliable transmission?

Front: TCP three handshakes

Medium: packet loss retransmission (confirm retransmission number)

Window size: same as sending and receiving

After: TCP Quad breakup (full duplex)

Connection oriented: a connection needs to be established before transmission



TCP working process:

1. Establish TCP connection (before): three handshakes



2. Transmission process (in process): packet loss retransmission



3. Close TCP connection (after): four Breakups



UDP: User Datagram Protocol

Advantages: fast disadvantages: unreliable transmission




Why can’t UDP guarantee reliability?

There is no reliable confirmation mechanism in the message

Why is UDP fast?

The header message has only 8 bytes

Under what circumstances will UDP encapsulation be used?

Flow for time delay


Layer 3: network layer

Role: IP addressing routing forwarding

Packet fragmentation ——- MTU maximum transmission unit (1500b) — data packet

IP: Internet Protocol (Internet Interconnection Protocol)







ARP: Address Resolution Protocol

Find MAC address through IP address

ARP send request is sent in the form of broadcast

ARP response (replay) is sent in unicast form


Layer 2: — data link layer — data frame

Role: connect physical layer and network layer

Connect frame header and end



MAC address globally unique





It consists of two parts, namely supplier code and serial number, of which the first 24 represent supplier code,

Managed and assigned by IEEE (Internet task force)


communication mode

Unicast: it is the MAC address of your own computer, one-to-one

The 8th bit of the first byte of unicast MAC address is “0”

Broadcast: one to many

Broadcast MAC address: full FF (111111111111)

Multicast: one to many Tencent News

Multicast MAC address: the 8th bit of the first byte is “1”

Expression: usually expressed in hexadecimal numbers


Layer 1: ——- physical layer —— bitstream

Convert data frames into bitstreams for transmission


Recommended Today

Custom annotation to realize logical verification

In daily interface development, in order to ensure the stability and security of the interface, we generally need to deal with two kinds of verification in the interface logic: Parameter verification Business rule verification First, let’s look at parameter verification. 1、 Parameter verification Parameter verification is easy to understand. For example, when logging in, you […]