TCP IP Illustrated

114 a simple example well use our sock program to

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: UDP or the TCP checksum completely, since these are simple checksums and were not meant to catch all possible errors. 11.4 A Simple Example We'll use our sock program to generate some UDP datagrams that we can watch with tcpdump: bsdi % sock -v -u -i -n4 svr4 discard connected on 140.252.13.35.1108 to 140.252.13.34.9 bsdi % sock -v -u -i -n4 -w0 svr4 discard connected on 140.252.13.35.1110 to 140.252.13.34.9 The first time we execute the program we specify the verbose mode (-v) to see the ephemeral port numbers, specify UDP (-u) instead of the default TCP, and use the source mode (-i) to file:///D|/Documents%20and%20Settings/bigini/Docu...homenet2run/tcpip/tcp-ip-illustrated/udp_user.htm (5 of 29) [12/09/2001 14.46.58] Chapter 11. UDP: User Datagram Protocol send data instead of trying to read and write standard input and output. The -n4 option says to output 4 datagrams (instead of the default 1024) and the destination host is svr4. We described the discard service in Section 1.12. We use the default output size of 1024 bytes per write. The second time we run the program we specify -w0, causing 0-length datagrams to be written. Figure 11.6 shows the tcpdump output for both commands. 1 2 3 4 5 6 7 8 0.0 bsdi.1108 0.002424 ( 0.0024) bsdi.1108 0.006210 ( 0.0038) bsdi.1108 0.010276 ( 0.0041) bsdi.1108 41.720114 (41.7098) bsdi.1110 41.721072 ( 0.0010) bsdi.1110 41.722094 ( 0.0010) bsdi.1110 41.723070 ( 0.0010) bsdi.1110 > > > > > > > > svr4.discard: svr4.discard: svr4.discard: svr4.discard: svr4.discard: svr4.discard: svr4.discard: svr4.discard: udp udp udp udp udp udp udp udp 1024 1024 1024 1024 0 0 0 0 Figure 11.6 tcpdump output when UDP datagrams are sent in one direction. This output shows the four 1024-byte datagrams, followed by the four 0-length data-grants. Each datagram followed the previous by a few milliseconds. (It took 41 seconds to type in the second command.) There is no communication between the sender and receiver before the first datagram i...
View Full Document

Ask a homework question - tutors are online