have their own strengths and weaknesses, and are suitable for communication environments with different requirements. The differences between the TCP protocol and the UDP protocol are shown in the appendix. 1. Brief Introduction to UDPUDP is a transport layer protocol, which is in a layer with TCP protocol. However, unlike T
the characteristics of TCP and UDP. TCP is connection-oriented. That is to say, during the connection continuity process, the data received by the socket is sent by the same host (hijacking is not considered). Therefore, you only need to know how much data is read each time.
UDP is a connectionless protocol, that is,
One. What are the main functions of the transport layer?Split and reassemble the data streams provided by the upper layer to provide end-to-end transport services for the data flow.two. How does the transport layer differentiate the data flow of different applications? Because, for the transport layer, it only needs to know which service program on the target host responds to the program, without needing to know what the service program is doing. Therefore, we only need to be able to represent t
confirmation after receiving the UDP message. Although UDP does not provide reliable delivery, in some cases UDP is the most efficient way to work.
(2) Transmission Control Protocol TCP (transmission-Protocol)
TCP provides connection-oriented services.
addition to its own content, but also includes some other data packet data, so a small number of packet loss can be through other packets of redundant data directly assembled without retransmission.
This is similar to the network layer of RAID 5.
At present, the default redundancy is 10%, which can rebuild a lost packet with redundant data for each 10 packets sent.
Forward correction sacrifices the upper limit on the amount of data that each packet can send, but reduces the data retransmission
the analysis
What is the difference between analyzing a UDP message and a TCP message? Realize the difference between UDP protocol and TCP protocol
Analysis Results and summary1. Acquiring and analyzing TCP messages(1) Log in to the FTP server: 172.18.3.154 es
the server port)socket: host ip+ port number, only through the IP address and port number, only to determine the port of a connection. Uniquely identifies an application process in a host on the network.Udp:User Datagram Protocol, the implementation of non-connected services, no confirmation, unreliable delivery, low
Four layers found that the purpose of four layer discovery is to scan out the possible IP address, four layer discovery, although involving port scanning, but does not accurately judge the status of the port, its essence is to use some of the four layer protocol communication to identify the existence of host IP. Four-layer Discovery benefits:
1, can be r
reliability, while UDP is a simple protocol that sends packets as much as possible. TCP is more complex and requires a lot of functional overhead, while UDP is simple and efficient. UDP is generally considered unreliable because it does not have any reliability mechanism of TCP
httpNmap done: 1 IP address (1 host up) scanned in 1274.21 seconds
3.2nmap also has a reason to perform UDP scan, such as some UDP-based services, SNMP, TFTP, DHCP, DNS, etc.
[emailprotected]:~# nmap -sU 192.168.115.188Starting Nmap 6.47 ( http://nmap.org ) at 2014-10-23 20:21 CSTNmap scan report for 192.168.
means this is a sack packet length of 2, no content part
8 indicates a timestamp, length is 10, and 8 bytes of time stamp*/
typedef struct _TCP_OPTIONS{Char M_ckind;Char m_clength;Char m_ccontext[32];}__ATTRIBUTE__ ((Packed)) tcp_options, *ptcp_options;
the definition of UDP head structure
/*UDP header definition, total 8 bytes */
typedef struct _UDP_HEADER{unsigned short m_ussourport; Source
information is transmitted, a response signal is required when the connection is disconnected, which increases the resource overhead for the connection protocol. For TCP and UDP protocols, apart from the source port and destination port, TCP also includes serial number, val
M_ssourport; Source Port number 16bitShort M_sdestport; Destination port number 16bitunsigned int m_uisequnum; Serial number 32bitunsigned int m_uiacknowledgenum; Confirmation Number 32bitShort M_sheaderlenandflag; Top 4 bits: TCP header length, medium 6 bit: reserved, last 6 bits: Flag bitShort m_swindowsize; Window Size 16bitShort m_schecksum; Inspection and 1
-65535, generally we use a certain software, such as QQ, and other services, randomly take this range of ports, rather than to get the front of which fixed, get the communication end, will release the port.Know what the port is? What did the transport layer specifically do? Transport layer is to connect two ports to communicate media, otherwise the light knows what two ports are used, how to communicate, or to rely on transport layer to do this thing,
port number with a unique identity on the network can be combined to form a uniquely identifiable identifier socket. socket principle mechanism:? There are sockets on both ends of the communication. ? network communication is actually the communication between sockets. ? data is transmitted via IO between two sockets. UDP Transport
Datagramsocket and Datagrampacket
establish the sending end, t
wait for the response from the receiver and confirm whether the information is transmitted, a response signal is required when the connection is disconnected, which increases the resource overhead for the connection protocol. For TCP and UDP protocols, apart from the source port and destination port,
oriented;In the UDP protocol, recvfrom this receive function will always remain blocked, because the server itself does not know that the client has exited or disconnected, proving that it is facing a non-connected.It can also be clearly seen that TCP communication requires the server to listen for listen, receive client connection request accept, wait for the client connect to establish a connection befor
receives the closed request message, it returns a confirmation message to the server, in which the ack=1, acknowledge Number=n+1,client enter the TIME_WAIT state. After the server receives the acknowledgement message, it disconnects from the client, and the two-way connection is closed.4. UDP Message Header formatUDP is similar to TCP is the Transport layer protocol, is also based on IP protocol, so in the
.
Description of Use:
Solve the data in the network can be transmitted efficiently
Relationship Description:
In the OSI reference Model, only TCP and UDP two, TCP need link security efficiency is low, UDP wireless connection is not safe and efficient, we usually use long HTTP protocol based on
data. The value is the ordinal of the last 1 bytes of the emergency data, which represents the offset of the message segment ordinal. For example, if the sequence number of the message segment is 1000 and the first 8 bytes are emergency data, then the emergency pointer is 8. The general purpose of the emergency pointer is to enable the user to abort the process.
One) option, fill field
This may include options such as window enlargement factor, timestamp, and so on. The length is
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.