Overview of Computer Networks

Start from the beginning
                                        

is established. Note also that there are limits to the length of a UDP datagram, typically around 8K or so,

depending on the platform.

4.1.4 IP Addresses

Each node on the Internet has an IP address, a 32-bit number.13 Usually this is written for human consumption

as four numbers, specifically the values in each of the four bytes of the address. The IP address of the

machine garnacha.engr.ucdavis.edu, for instance, is 169.237.126.236.14

When TCP or UDP passes a packet to IP, the latter will determine where it should be sent in order to

ultimately reach its proper destination. For instance, if the machine has two NICs, IP must decide which

one to pass the packet to.

4.1.5 Peer Communication

An application program using TCP or UDP will be communicating with its peer using TCP or UDP on the

remote machine. Typically one of these programs will be a service provider and thus is termed the server,

and the other will be the service requester, called the client. For instance, when you use the ftp program, it

is a client, and the server is the ftpd program ("ftp daemon") running on the remote machine.15

For the application programmer, it would be extremely inconvenient to have to code the actual packet formation.

Thus it would be nice to provide functions which access TCP and IP from a somewhat higher level.

One popular type of such functions is sockets, which to the programmer look very similar to file handles.

Again the sockets form peer relationships with each other. Consider ftp again, for instance, with a put

operation. On your end, ftp writes data to its socket, and at the destination machine ftpd will read from its

socket.16 The two sockets were associated with each other at the time they were created. Similarly, the TCP

layer on your machine will think of itself communicating with the TCP layer at the destination machine.

4.1.6 Viewing Current Socket Status

On UNIX machines, the netstat command will show you the current status of all open sockets; there is a

version on Microsoft Windows machines too.

Next time you are on a UNIX machine, run the netstat command twice, once before and once during an ftp

13128 bits in the new IP 6 system.

14This node no longer exists. The College of Engineering "Mexican food series" of machines was phased out some years ago,

but I've kept the examples. Of course, the principles are still valid, regardless of which machines we use.

15The next time you are on a UNIX system, type "ps ax" (or "ps -e" or "ps -ux", depending on the system) to see all the currentlyresident

processes. You will may see one or more ftpd processes there. If not, do an ftp from another machine to this one, and list

the processes again; you should now see ftpd. There is another daemon, inetd, which intercepts calls to services like ftpd, invoking

these services as needed.

16In the case of a get opeation, these two operations would be reversed.

You've reached the end of published parts.

⏰ Last updated: May 09, 2009 ⏰

Add this story to your Library to get notified about new parts!

Overview of Computer NetworksWhere stories live. Discover now