TCP IP Illustrated

TCP IP Illustrated

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: y receive UDP datagrams from that specific IP address and port number. Our sock program uses the -f option to specify the foreign IP address and port number: sun % sock -u -s -f 140.252.13.35.4444 5555 This sets the foreign IP address to 140.252.13.35 (our host bsdi) and the foreign port number to 4444. The server's well-known port is 5555. If we run netstat we see that the local IP address has also been set, even though we didn't specify it: Proto Recv-Q Send-Q Local Address Foreign Address (state) file:///D|/Documents%20and%20Settings/bigini/Doc...omenet2run/tcpip/tcp-ip-illustrated/udp_user.htm (26 of 29) [12/09/2001 14.46.58] Chapter 11. UDP: User Datagram Protocol udp 0 0 140.252.13.33.5555 *.* This is a side effect of specifying the foreign IP address and foreign port on Berkeley-derived systems: if the local address has not been chosen when the foreign address is specified, the local address is chosen automatically. Its value becomes the IP address of the interface chosen by IP routing to reach the specified foreign IP address. Indeed, in this example the IP address on sun for the Ethernet that is connected to the foreign address is 140.252.13.33. Figure 11.22 summarizes the three types of address bindings that a UDP server can establish for itself. Local Address Foreign Address localIP.lport localIP.lport *. lport Description restricted to one client foreignIP.fport restricted to datagrams arriving on one local interface: *.* localIP *.* receives all datagrams sent to lport Figure 11.22 Specification of local and foreign IP addresses and port number for UDP server. In all cases, lport is the server's well-known port and localIP must be the IP address of a local interface. The ordering of the three rows in the table is the order that the UDP module applies when trying to determine which local end point receives an incoming datagram. The most specific binding (the first row) is tried first, and the least specific (the last row with both IP addresses wildcarded) is tried last. Multiple Recipients per Port Although it's not sp...
View Full Document

This test prep was uploaded on 04/04/2014 for the course ECE EL5373 taught by Professor Guoyang during the Spring '12 term at NYU Poly.

Ask a homework question - tutors are online