DE-CIX Academy Handout

DE-CIX Academy Handout

Networking Basics 04 - User Datagram Protocol (UDP) Wolfgang Tremmel [email protected] DE-CIX Management GmbH | Lindleystr. 12 | 60314 Frankfurt | Germany Phone + 49 69 1730 902 0 | [email protected] | www.de-cix.net Networking Basics DE-CIX Academy 01 - Networks, Packets, and Protocols 02 - Ethernet 02a - VLANs 03 - the Internet Protocol (IP) 03a - IP Addresses, Prefixes, and Routing 03b - Global IP routing 04 - User Datagram Protocol (UDP) 05 - TCP ... Layer Name Internet Model 5 Application IP / Internet Layer 4 Transport • Data units are called "Packets" 3 Internet 2 Link Provides source to destination transport • 1 Physical • For this we need addresses • Examples: • IPv4 • IPv6 Layer Name Internet Model 5 Application Transport Layer 4 Transport 3 Internet 2 Link 1 Physical Layer Name Internet Model 5 Application Transport Layer 4 Transport • May provide flow control, reliability, congestion 3 Internet avoidance 2 Link 1 Physical Layer Name Internet Model 5 Application Transport Layer 4 Transport • May provide flow control, reliability, congestion 3 Internet avoidance 2 Link • Examples: 1 Physical • TCP (flow control, reliability, congestion avoidance) • UDP (none of the above) Layer Name Internet Model 5 Application Transport Layer 4 Transport • May provide flow control, reliability, congestion 3 Internet avoidance 2 Link • Examples: 1 Physical • TCP (flow control, reliability, congestion avoidance) • UDP (none of the above) • Also may contain information about the next layer up Encapsulation Packets inside packets • Encapsulation is like Russian dolls Attribution: Fanghong. derivative work: Greyhood https://commons.wikimedia.org/wiki/File:Matryoshka_transparent.png Encapsulation Packets inside packets • Encapsulation is like Russian dolls • IP Packets have a payload Attribution: Fanghong. derivative work: Greyhood https://commons.wikimedia.org/wiki/File:Matryoshka_transparent.png Encapsulation Packets inside packets • Encapsulation is like Russian dolls • IP Packets have a payload • This payload is usually UDP or TCP (there are others as well) Attribution: Fanghong. derivative work: Greyhood https://commons.wikimedia.org/wiki/File:Matryoshka_transparent.png Encapsulation Packets inside packets • Encapsulation is like Russian dolls • IP Packets have a payload • This payload is usually UDP or TCP (there are others as well) • So we have an UDP packet inside an IP packet Attribution: Fanghong. derivative work: Greyhood https://commons.wikimedia.org/wiki/File:Matryoshka_transparent.png IPv4 Header "Legacy" IP Byte 0 1 2 3 • Starts with version and length Version | Header Length Total Length 0 DSCP / ECN • Total length of packet 20..65535 always 4 | 5..15 • Important: Time to live (TTL) 4 Identification Flags / Fragment Offset 8 Time To Live Protocol Header Checksum • Protocol: Type of payload 12 Source IPv4 Address Destination IPv4 Address TCP = 6, UDP = 17 16 • 20 24 Optional (if HeaderLength > 5) • Source / Destination address 32 bits 28 32 • Options (optional) IPv4 Header "Legacy" IP Byte 0 1 2 3 • Starts with version and length Version | Header Length Total Length 0 DSCP / ECN • Total length of packet 20..65535 always 4 | 5..15 • Important: Time to live (TTL) 4 Identification Flags / Fragment Offset 8 Time To Live Protocol Header Checksum • Protocol: Type of payload 12 Source IPv4 Address Destination IPv4 Address TCP = 6, UDP = 17 16 • 20 24 Optional (if HeaderLength > 5) • Source / Destination address 32 bits 28 32 • Options (optional) IPv6 Header Looks simpler, yes? Byte 0 1 2 3 • Starts with version and some labels 0 Version = 6 / Traffic Class / Flow Label Payload Length Next Payload length in bytes (0-65535) 4 Hop Limit • in bytes Header 8 • Next Header - you can chain more 12 Source IPv6 Address headers 16 20 • replaces protocol field, same 24 values 28 Destination IPv6 Address 32 • Hop Limit replaces TTL 36 • Addresses are now 128bits Next header: Transport layer header TCP, UDP, and more Byte 0 1 2 3 0 Version = 6 / Traffic Class / Flow Label Payload Length Next 4 Hop Limit in bytes Header 8 12 Source IPv6 Address 16 20 24 28 Destination IPv6 Address 32 36 Next header: Transport layer header TCP, UDP, and more Byte 0 1 2 3 • We start with the "easiest" 0 Version = 6 / Traffic Class / Flow Label protocol Payload Length Next 4 Hop Limit in bytes Header 8 12 Source IPv6 Address 16 20 24 28 Destination IPv6 Address 32 36 Next header: Transport layer header TCP, UDP, and more Byte 0 1 2 3 • We start with the "easiest" 0 Version = 6 / Traffic Class / Flow Label protocol Payload Length Next 4 Hop Limit in bytes Header • UDP 8 12 Source IPv6 Address 16 20 24 28 Destination IPv6 Address 32 36 Next header: Transport layer header TCP, UDP, and more Byte 0 1 2 3 • We start with the "easiest" 0 Version = 6 / Traffic Class / Flow Label protocol Payload Length Next 4 Hop Limit in bytes Header • UDP 8 12 Source IPv6 Address • User Datagram Protocol 16 20 24 28 Destination IPv6 Address 32 36 Next header: Transport layer header TCP, UDP, and more Byte 0 1 2 3 • We start with the "easiest" 0 Version = 6 / Traffic Class / Flow Label protocol Payload Length Next 4 Hop Limit in bytes Header • UDP 8 12 Source IPv6 Address • User Datagram Protocol 16 20 • Protocol ID is 17 24 28 Destination IPv6 Address 32 36 Next header: Transport layer header TCP, UDP, and more Byte 0 1 2 3 • We start with the "easiest" 0 Version = 6 / Traffic Class / Flow Label protocol Payload Length Next 4 Hop Limit in bytes Header • UDP 8 12 Source IPv6 Address • User Datagram Protocol 16 20 • Protocol ID is 17 24 28 Destination IPv6 Address • Introduced in 1980 32 36 Next header: Transport layer header TCP, UDP, and more Byte 0 1 2 3 • We start with the "easiest" 0 Source Port Destination Port protocol • UDP 4 Length Checksum • User Datagram Protocol • Protocol ID is 17 • Introduced in 1980 • Lets have a look at the header UDP Header Byte 0 1 2 3 0 Source Port Destination Port 4 Length Checksum UDP Header • 4 fields, each of them 16 bits Byte 0 1 2 3 0 Source Port Destination Port 4 Length Checksum UDP Header • 4 fields, each of them 16 bits Byte 0 1 2 3 • Length: UDP header + UDP payload 0 Source Port Destination Port 4 Length Checksum UDP Header • 4 fields, each of them 16 bits Byte 0 1 2 3 • Length: UDP header + UDP payload 0 Source Port Destination Port • Checksum • Optional for IPv4, required for IPv6 4 Length Checksum • IP header + UDP header are covered UDP Header • 4 fields, each of them 16 bits Byte 0 1 2 3 • Length: UDP header + UDP payload 0 Source Port Destination Port • Checksum • Optional for IPv4, required for IPv6 4 Length Checksum • IP header + UDP header are covered • Source Port • Optional, zero if not used UDP Header • 4 fields, each of them 16 bits Byte 0 1 2 3 • Length: UDP header + UDP payload 0 Source Port Destination Port • Checksum • Optional for IPv4, required for IPv6 4 Length Checksum • IP header + UDP header are covered • Source Port • Optional, zero if not used • Destination Port number • required Port number Port number Port number UDP Destination port: 7 Port number UDP Destination port: 7 ? Port number 1 2 3 4 5 UDP 6 7 8 9 10 Destination port: 7 ? 11 12 13 14 Port number 1 2 3 4 5 UDP 6 7 8 9 10 Destination port: 7 11 12 13 14 Port number 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Port numbers In reality... Port numbers In reality... • Of course we have not a building Port numbers root@linux:/tmp# netstat -an -u In reality... Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State udp 0 0 0.0.0.0:514 0.0.0.0:* udp 0 0 0.0.0.0:631 0.0.0.0:* udp 0 0 127.0.0.1:690 0.0.0.0:* • Of course we have not a building udp 0 0 0.0.0.0:45769 0.0.0.0:* udp 0 0 0.0.0.0:50191 0.0.0.0:* udp 0 0 0.0.0.0:5353 0.0.0.0:* udp 0 0 0.0.0.0:46721 0.0.0.0:* • We have a computer system udp 0 0 0.0.0.0:2049 0.0.0.0:* udp 0 0 127.0.0.1:39032 127.0.0.1:53 ESTABLISHED udp 0 0 0.0.0.0:43291 0.0.0.0:* udp 0 0 0.0.0.0:47544 0.0.0.0:* udp 0 0 127.0.0.1:52197 127.0.0.1:53 ESTABLISHED udp 0 0 0.0.0.0:36005 0.0.0.0:* udp 0 0 0.0.0.0:56663 0.0.0.0:* udp 0 0 0.0.0.0:60949 0.0.0.0:* udp 0 0 0.0.0.0:53 0.0.0.0:* udp 0 0 0.0.0.0:53 0.0.0.0:* udp 0 0 0.0.0.0:111 0.0.0.0:* udp 0 0 192.168.5.3:123 0.0.0.0:* udp 0 0 192.168.1.45:123 0.0.0.0:* Port numbers root@linux:/tmp# netstat -an -u In reality... Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State udp 0 0 0.0.0.0:514 0.0.0.0:* udp 0 0 0.0.0.0:631 0.0.0.0:* udp 0 0 127.0.0.1:690 0.0.0.0:* • Of course we have not a building udp 0 0 0.0.0.0:45769 0.0.0.0:* udp 0 0 0.0.0.0:50191 0.0.0.0:* udp 0 0 0.0.0.0:5353 0.0.0.0:* udp 0 0 0.0.0.0:46721 0.0.0.0:* • We have a computer system udp 0 0 0.0.0.0:2049 0.0.0.0:* udp 0 0 127.0.0.1:39032 127.0.0.1:53 ESTABLISHED udp 0 0 0.0.0.0:43291 0.0.0.0:* • But we have port numbers udp 0 0 0.0.0.0:47544 0.0.0.0:* udp 0 0 127.0.0.1:52197 127.0.0.1:53 ESTABLISHED udp 0 0 0.0.0.0:36005 0.0.0.0:* udp 0 0 0.0.0.0:56663 0.0.0.0:* udp 0 0 0.0.0.0:60949 0.0.0.0:* udp 0 0 0.0.0.0:53 0.0.0.0:* udp 0 0 0.0.0.0:53 0.0.0.0:* udp 0 0 0.0.0.0:111 0.0.0.0:* udp 0 0 192.168.5.3:123 0.0.0.0:* udp 0 0 192.168.1.45:123 0.0.0.0:* Port numbers root@linux:/tmp# netstat -an -u In reality..

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    92 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us