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
-
China's Mainland General Display Exports Continue to Grow, But at a Slower PaceDetail
2024-11-05 10:37:59 1
- Detail
-
The State of Cybersecurity in the Financial Services Industry: DDoS Attacks, API Threats, and Mitigation StrategiesDetail
2024-11-04 17:35:37 1
- Detail
-
Seres New Energy Vehicle Sales Surpass 30,000 Units in October, AITO M9 Receives Over 160,000 Pre-orders, Topping Luxury Vehicle Sales Above 500,000 Yuan for Six Consecutive MonthsDetail
2024-11-04 15:17:57 1
-
Shenzhou-18 Triumphantly Returns! Chinese Astronauts Successfully Return to Earth, Sparking Technological ReflectionsDetail
2024-11-04 14:37:46 1
- Detail
-
Why Did WeChat's "Shake" and "Drift Bottle" Disappear? Netizens Share: From Love, Opportunities to AnecdotesDetail
2024-11-02 10:12:09 1
-
Methane Hydrate: From High Hopes to Diminished Enthusiasm, Does It Have a Future?Detail
2024-11-01 20:50:31 1
- Detail
-
Microsoft Announces End of Support for Windows 10 on October 14, 2025, Strongly Recommends Migration to Windows 11Detail
2024-11-01 12:01:58 11
-
Unlocking Another Dimension of the World: From Urban Movement to Outdoor Nouveau RicheDetail
2024-11-01 11:41:06 21
- Detail
- Detail
-
Kuaishou Rural Ecology Conference Kicks Off, Joining Hands with New Farmers to Create a Better LifeDetail
2024-11-01 10:21:07 21
-
Didi Station Bus Empowers Passenger Transport Enterprises to Transform and Upgrade, Providing Convenient and Efficient Travel Services for PassengersDetail
2024-11-01 10:18:08 1
-
Amazon Battles Temu and SHEIN: Can Increased Essentials Sales Revitalize the Giant?Detail
2024-11-01 10:04:45 1
- Detail
-
Returning to Natural Interaction: Hanwang Technology's MOUNTAIN Series Handwritten Notebook Ushers in a New Era of "Native Office"Detail
2024-10-31 15:33:14 1