TCP/IP Fundamentals
AD |
I have compiled my previous articles into Github. Welcome everyone, starhttps://github
I have compiled my previous articles into Github. Welcome everyone, star
https://github.com/crisxuan/bestJavaer
This article has been submitted
If we have the most exposure to computer networks, it is inevitable that we cannot do without the TCP/IP protocol. TCP/IP protocol is also the most famous protocol in the Internet. Let's talk about the TCP/IP protocol together.
The Historical Background of TCP/IP
When there was no TCP/IP protocol in the early 1960s, many countries and regions recognized the importance of communication technology. The US Department of Defense hopes to study a technology that can communicate through other routes even if communication lines are disrupted. In order to implement this technology, agroupingNetwork.
Even if several nodes are damaged during the communication process between two nodes, communication between the two nodes can still be achieved by changing the circuit or other means.
grouping ARPANET(AdvancedResearchProjectsAgencyNetwork)The birth of. ARPANET was the first wide area packet divided t group switching network with distributed control, and also the precursor to the earliest implementation of TCP/IP protocol.
ARPANET is actually planned and established by the Advanced Research Projects Agency of the US Department of Defense.
So, the emergence of computer networks was initially for military research purposes.
In the 1990s, IOS launched the international standardization process of OSI, but did not make substantial progress, but it made the TCP/IP protocol widely used.
The reason for the rapid development of TCP/IP protocol may be due to the standardization of TCP/IP. That is to say, the TCP/IP protocol will involve standards that OSI does not have, and this standard will be the main content we will explore next.
Here, let's first understand the TCP/IP protocol. TCP/IP protocol not only refers to TCP and IP, but also refers to the protocol cluster. What is the protocol cluster? Simply put, it is a synthesis of a series of protocols. If you ask you about the TCP/IP protocols next time, you can share the following image with him
Taken together, the above protocols form the TCP/IP protocol cluster.
TCP/IP standard
Compared to other protocol standards, TCP/IP places more emphasis on two points:OpennessandpracticabilityWhether standardization can be used in practice.
Openness TCP/IP IETFThe IETF itself is an organization that allows anyone to participate in discussions.
practicability
The standard protocol of TCP/IP is well-known to usRFC DocumentOf course, you can see it online. RFC not only standardizes protocol standards, but also includes information on protocol implementation and usage.
For more RFC protocols, you can take a look at the official documentation https://www.rfc-editor.org/rfc-index.html
We won't go into detail here, the focus of our article will be on the study of TCP/IP.
TCP/IP protocol cluster
TCP/IP protocol cluster
TCP/IP protocol is the protocol that our programmers contact most. The OSI model has seven layers, from bottom to top, namely the physical layer, the data link layer, the network layer, the transport layer, the session layer, the presentation layer, and the application layer. But this is obviously a bit complex, so in the TCP/IP protocol, they are simplified into four levels
Let's start with the communication link layer and introduce these layers and the protocols between them.
Communication link layer
Communication link layer physical layerandData link layer
physical layer
physical layer TCP/IP physical layer
Data link layer
Data link layerData link layerphysical layernetwork layerData link layer
network layer
network layer IPProtocol, IP protocol forwards packet data based on IP address.
IP grouping
The functionality of the Internet layer and transport layer in TCP/IP layering is typically provided by the operating system.
IP Data link layer IP
IP grouping IP IP
network layer ICMPBecause IP may encounter exceptions during the sending process of packets, when IP packets cannot reach the destination address due to exceptions, an exception notification needs to be sent to the sending end. The main function of ICMP lies in this. Given this situation, ICMP can also be used to diagnose network conditions.
Transport layer
TCP/IP IP Transport layerTCP Transport layer
Transport layer
Transport layerapplication layer
Transport layer TCP UDP
TCP
TCP is a reliable protocol that ensures the reliable delivery of data packets. TCP can correctly handle abnormal situations such as packet loss and disordered transmission sequence during the transmission process. In addition, TCP also provides congestion control to alleviate network congestion.
UDP
UDP is an unreliable protocol that cannot guarantee the reliable delivery of data. Compared to TCP, UDP does not check for packet arrival or network congestion, but its efficiency is relatively high.
UDP grouping
application layer
TCP/IP protocol cluster OSI application layerapplication layer/
The sending history of data packets
application layernetwork layerCommunication link layer
Packet structure
Let's first understand the structure of data packets. Here, we will only give you a brief introduction, and the following articles will provide a more detailed introduction.
In each layer above, an additional one will be added to the sent dataFirst partFirst part
Packet sending history
Assuming that Host A and Host B communicate, what unique operations will Host A undergo if they want to send a data packet to Host B?
application layer
Host A means that the user clicks on an application or opens a chat window to inputcxuan cxuan application layer OSI TCP/IP application layer
At the moment the packet is sent, a TCP connection is established, which acts as a channel, and after that, other packets will also use the channel to transmit data.
Transport layer
In order to accurately describe the information that can reach the other party, we use the TCP protocol for description. TCP is responsible for establishing connections, sending data, and disconnecting connections according to the application's instructions.
TCP TCP First partTCP First partSource Port NumberandDestination Port NumberTCP First partSerial numberTCP First part Checksum TCP First part IP
network layer
network layer IP IP TCP TCP First part TCP First part IP First partIP TCP IP First part IP First part TCP UDP
After the IP packet is generated, the routing control table will determine which host should be sent to, and the IP modified data packet will continue to be sent down to the router or network interface driver to achieve true data transmission.
If you do not know the IP address of the target host, you can useARP(AddressResolutionProtocol)Address Resolution Protocol for lookup.
Communication link layer
IP First partFirst part MAC MAC
The following is the complete processing and parsing process.
application layer
The receiving process of data packets is the reverse order process of the sending process, and the parsing of data packets also goes through the following steps.
Analysis of communication links
First part MAC
If the received packet is sent to oneself, it will look up the Ethernet type to determine which protocol it is. If it is an IP protocol, it will be thrown to the IP protocol for processing. If it isARPThe protocol will be thrown to the ARP protocol for processing. If the protocol type is an unrecognized protocol, the data packet will be directly discarded.
network layer
network layer IP IP IP First part IP First part IP IP TCP UDP
Note: In the process of routing forwarding, sometimes the IP address is not your own, and in this case, you need to use a routing table to assist in processing.
Transport layer
Transport layer TCP TCP ChecksumSerial number
After the data is fully recognized, it will be passed to the application identified by the port number for processing.
Application processing
The designated application program on the receiving end will process the data passed by the sender, identify the content of the data through decoding and other operations, and then store the corresponding data on disk, returning a successful save message to the sender. If the save fails, an error message will be returned.
The above is a complete packet sending and receiving process, which involves addresses, port numbers, protocol types, etc. between different layers. Let's analyze it now.
First partFirst part
First partFirst part MAC IP IP TCP/UDP
First part
summary
cxuan Data link layer
Hello, I am cxuan, a technician. I have written a total of six PDFs
Java summary
HTTP summary
Basic Knowledge that Programmers Must Know
summary
Java Core Fundamentals 2.0
Java summary
Now I have released the Baidu link to everyone, and you can click on the link below to claim it
Link: https://pan.baidu.com/s/1mYAeS9hIhdMFh2rF3FDk0A Password: p9rs
Disclaimer: The content of this article is sourced from the internet. The copyright of the text, images, and other materials belongs to the original author. The platform reprints the materials for the purpose of conveying more information. The content of the article is for reference and learning only, and should not be used for commercial purposes. If it infringes on your legitimate rights and interests, please contact us promptly and we will handle it as soon as possible! We respect copyright and are committed to protecting it. Thank you for sharing.(Email:[email protected])
Mobile advertising space rental |
Tag: TCP IP Fundamentals
No matter how busy you are, maintaining health is always the most long-term issue!
NextThe speed of high-tech development is much faster than we imagine, robots becoming wives
Guess you like
- Detail
- Detail
-
Ant Group Powers the Greater Bay Area's "One-Hour Living Circle" and Fuels Global "ChinaTravel Boom"Detail
2024-11-21 19:23:04 1
-
Shenzhen's First Roadside Supercharger Station Commences Trial Operation, Ushering in a New Era for the "Supercharging City"Detail
2024-11-21 11:25:06 1
-
Xiaomi's High-End Strategy: An In-Depth Analysis of Q3 2024 Financial Results and Future OutlookDetail
2024-11-19 23:07:40 1
-
TSMC's Sudden Shift: A Global Chip Giant's Difficult Choices in the US-China GameDetail
2024-11-19 12:27:48 1
-
International Space Station Leak Crisis: NASA's Emergency Evacuation Plan and Signals of Chinese CooperationDetail
2024-11-19 11:34:51 1
-
Ten Years of Searching: Li Eryou's Unwavering Hope in the Search for His Son on MH370Detail
2024-11-18 18:39:16 1
-
The Facial Swelling of Shenzhou 18 Astronauts: The Physiological Cost of Space Exploration and Future ChallengesDetail
2024-11-17 08:03:04 11
-
Xiaomi Automobile Unveils Intelligent Chassis Pre-Research Technology, Ushering in a New Era of "Human-Car-Home Full Ecosystem"Detail
2024-11-14 11:24:27 1
-
Douyin E-commerce Double 11 Data Report: Merchants Businesses Grow, Consumer Trends EmergeDetail
2024-11-14 11:23:11 1
-
New Trends in SOE Reform: Focusing on Five Values to Build a "Living Organism"Detail
2024-11-14 11:19:26 1
-
CATL Chairman Zeng Yuqun: Musk Doesn't Understand Batteries, Tesla's Bet on Cylindrical Batteries is Doomed to FailDetail
2024-11-13 18:47:38 11
-
China Eastern Airlines Technology and Thales Renew Cooperation Agreement, Deepening Avionics Maintenance PartnershipDetail
2024-11-13 16:40:50 1
- Detail
- Detail
- Detail
-
Li Jiaqi's Livestream Double 11 Report: Domestic Brands Surge, Winter Warmer Economy BoomsDetail
2024-11-12 11:07:26 11
-
BYD: Plug-in Hybrids "To the Rescue," Behind the Price War Lies a "Davis Double-Click" in ProfitabilityDetail
2024-11-12 10:49:05 1
-
The Rise of Online Livestreamers: A Mass Career with 15 Million Dream Chasers in Live RoomsDetail
2024-11-11 15:27:33 11