TCP/IP Explained: Protocols (UDP, Broadcast and Multicast)

Chapter 11: UDP: User Datagram Protocol

  • UDP does not provide reliability
  • The TCP port number is viewed by TCP, and the UDP port number is viewed by UDP; the TCP port number and the UDP port number are independent of each other
  • UDP header 
    write picture description here  
    write picture description here 
    • UDP checksum optional, covering UDP header and UDP data
    • If the sender does not calculate the checksum and the receiver detects an error in the checksum, the UDP datagram is silently discarded. No error message is generated (it does so when the IP layer detects an error in the IP header checksum).
  • Not all Ethernet data frames are IP datagrams, at least Ethernet also uses ARP protocol
  • IP Fragmentation 
    • Refer to TCP/IP detailed explanation: protocol (network layer), the identification field in the IP datagram represents a unique IP datagram (when a datagram is divided into multiple pieces, the identification fields of the multiple pieces are the same); 1bit in the flag field is set to 1 means there are more slices, 0 means the last slice; the slice offset field refers to the position where the slice offsets the beginning of the original datagram
    • Although the IP fragmentation process appears to be transparent, there is one thing that makes people not want to use it: even if only one piece of data is lost, the entire datagram must be retransmitted; the reason is that the IP layer itself does not have a mechanism for supermarket retransmission, and neither does UDP, and TCP have
    • Fragmentation process, except for the last piece, the data part in each other piece (except the rest of the IP header) must be an integer multiple of 8 bytes
  • Any transport layer header only appears in the first slice of data 
    write picture description here
  • ICMP unreachable error (fragmentation required) 
    write picture description here 
    use the ping program to test the path MTU
  • ICMP source port migration error: when a system (router or host) receives datagrams faster than it can process them, it may occur 
    write picture description here 
  • Design of UDP Server 
    • Client IP and port number
    • destination IP address
    • UDP input queue
    • Restrict local IP and remote IP 
      write picture description here
    • Multiple endpoints can use the same IP address and UDP port number

Chapter 12: Broadcast and Multicast

  • Broadcast and multicast apply only to UDP
  • Unicast : Each Ethernet frame is only sent to a single destination host, the destination address indicates a single receiving interface, and the communication of any two hosts will not interfere with other hosts in the network (except for the situation that may cause competition for shared channels)
  • Broadcast : A host wants to send a frame to all other hosts on the network
  • Multicast : Frames are delivered only to multiple hosts belonging to a multicast group
  • The host will filter the frames transmitted by the channel, and the 
    write picture description here  
    driver will perform additional frame filtering. First, the protocol to be used (IP, ARP, etc.) must be specified in the frame type. Second, multicast filtering is performed to detect whether the host belongs to the multicast group specified by the multicast address.
  • Fourth broadcast address 
    • Restricted broadcast address 255.255.255.255. Under no circumstances will routers forward datagrams destined for restricted broadcast addresses, such datagrams only appear on the local network.
    • Broadcast address pointing to the network: an address whose host number is all 1s. A router must forward broadcasts destined for the network, but it must also have an option not to forward
    • The broadcast address pointing to the subnet: the address where the host number in a specific subnet is all 1.
    • Broadcast to all subnets: The difference from the broadcast address to the network is -- whether to divide the subnet
    • Broadcasting is a feature that should be used with caution. In many cases, IP multicasting proves to be a better solution
  • multicast 
    • IP multicast provides two services 
      • Transfer data to multiple destinations
      • client request to server
    • Multicast address 
      write picture description here 
      range: 224.0.0.0 to 239.255.255.255 
      write picture description here

Chapter 13: IGMP: Internet Group Management Protocol

  • IGMP messages are transmitted through IP datagrams. IGMP has a fixed message length and 
    no optional data 
    write picture description here 
    write picture description here 
    types: 1 indicates the query message sent by the multicast router, 2 indicates the 
    checksum of the report message sent by the host: here Recall: IP checksums only check the 20-byte IP header; while ICMP checksums cover the entire packet (ICMP header + ICMP data); UDP and TCP checksums cover not only the entire datagram, but also There is a 12-byte IP pseudo-header. IGMP and ICMP are the same
  • Join a multicast group. The basis of multicast is the concept of a process . A process can join the same multicast group on multiple interfaces.

http://blog.csdn.net/u014451076/article/details/52832169

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326224834&siteId=291194637