# Math 300: Mathematical Computing

Networking Basics

## Networking Basics

In order to understand the power of the Internet, it is essential that we know something about the layers of technology that make it up. It is traditional to discuss these layers using the OSI seven-layer network model (you can see some info at the Webopedia site), but this is becoming dated. Since our interests here are somewhat limited, and since it is coming to dominate network infrastructures, we will talk here only about ethernet networks using the TCP/IP suite of protocols for data transfer.

Ethernet networks based on TCP/IP for addressing and transmission control have have become the standard for local networks. The principal idea behind ethernet networks is the breaking up of data into packets. Each packet is a string of ones and zeros that contains a variety of information for interpretation by the receiving machine. Basically, there are some bits at the front of the packet that tell the receiving machine that info is coming, then some address and protocol information, followed by the actual contents to be transmitted, which may be as little as a single character. The packet finishes with some termination information. Thus, each packet is a little letter to the receiving computer that gives it another piece of the information it needs.

No letter can get to its destination without an address. A letter that is just for the person down the hall might be addressed adequately by putting her name on it. This corresponds roughly to the Media Access Control (MAC) address. The MAC address (aka Ethernet address, or machine address, or board address) is unique to the network card for the machine in question. It is composed of six octets. We usually write these in hexadecimal, separated by colons. Thus a MAC address might look like 00:50:DA:29:B1:2E. The first three octets are assigned to the manufacturers of the ethernet card, and the last three complete the unique identification of that card. To see the assignments for a given manufacturer, go to the mac_find site.

To discover the MAC address of a destination computer, your computer uses Address Resolution Protocol (ARP). This is simply a process for asking all nearby computers whether they answer for a given IP address, and if so, taking their MAC address so a packet can be delivered.

As you know, you rarely (if ever) refer to a computer by its IP address - you probably rarely even know its IP address. Instead, you call it by name. For example the name of the machine that sends you this page is www.math.wsu.edu. In order actually to find the machine on the network, that name must be mapped to the IP address of the computer. That is done through a query to a computer that runs the Domain Name Service (DNS). This is a piece of software that can tell inquiring computers the IP addresses of machines whose names are given, and likewise can tell the names of machines whose IP addresses are given. One may talk directly to DNS using the nslookup command (though this is old-fashioned), or by using the host or dig commands:

nslookup 134.121.45.19

host 134.121.45.19

dig -x 134.121.45.19

Once your machine knows the IP address of the destination machine, it consults its routing table to find out how to deliver it. The routing table tells what IP addresses may be considered local, and where to send mail to IP addresses that are not local. If the address is not local, the the packet is delivered to a gateway router, which knows how to forward the packet to the next hop on its trip to its destination. Eventually, the packet comes to a router that knows that the destination address is local for it, and it delivers the packet.

One rarely refers to IP by itself. Instead, people talk about TCP/IP. The TCP part stands for Transmission Control Protocol . While IP controls addressing and delivery for packets of information, TCP controls the details of the communication between two computers. You do not need to know many details of TCP, save the idea that it is designed so that no information is lost in the communication. TCP basically requires two computers to hold hands until all the information is delivered. It keeps track of the packets containing the information, and if a packet fails to be delivered, then TCP requires that it be sent again. This makes TCP an excellent protocol for sending large batches of information from one computer to another. For example, the protocol your browser relies on uses TCP to control data transmission.

There is another protocol that is mentioned less often, but is nonetheless important. UDP (user datagram protocol) is a less complex and costly protocol than TCP. UDP does not check delivery of packets. Instead, it relies on applications to realize that they have not heard from the computer they are trying to communicate with, and try again. UDP is usually used for e.g. network file system access. UDP also uses IP to address its packets.

It is worth mentioning one more protocol: ICMP is the Internet Control Message Protocol. It does what its name implies: it sends messages to control the way the real messages are sent. Users interact with it most often through the ping command. For example, to find out whether thetahat.math.wsu.edu is alive and on the internet, you may type

ping thetahat.math.wsu.edu

Alternatively, you may ping it by its IP address:

ping 134.121.45.26

There are many other types of ICMP traffic besides that generated by ping, but they are less important to us here.

To summarize in an example, suppose your computer x.math.wsu.edu wants to got to the web site www.poshusta.chem.wsu.edu. It must perform the following steps:

1. It does a name lookup to find out the IP address (134.121.43.37)
2. It looks in its routing table to see how to deliver a packet to 134.121.43.37.
3. It sees that the address is not local, so it sends a packet to the gateway (134.121.45.254) for forwarding.
4. The gateway looks in its routing tables for 134.121.43.37.
5. The gateway sees that 134.121.43.37 -is- local, so it sends an ARP request packet to every local machine.
6. 134.121.43.37 replies to that packet, sending its MAC address to the gateway.
7. The gateway forms an ethernet packet with 134.121.43.37's MAC address, and sends it directly to 134.121.43.37.

ICE

• Use the arp -a command to look at the MAC addresses of machines that are cached on your computer.
• Find out whether 134.121.45.19 is on line.
• Now use arp -a again to see the MAC address of that computer.
• Find out the name of 134.121.45.19.
• Find out the IP address of rainier.math.wsu.edu.
• What is the default gateway for your computer?
• How does your computer find www.wsu.edu?
• Go to a site for traceroute and tell it to trace the route to www.wsu.edu.

The last test will take place at the final exam time on Tuesday, 12 December, from 1:30-3:30. It will be written as a one-hour (not 50 minute) exam, but you may have the full two hours for it. In other respects it will be very like the other tests, but comprehensive - it will emphasize Python, but cover all the topics we have seen. There is a Sample Exam, but be aware that things will have changed somewhat with the advent of ChatGPT.

The scores are posted on the Info tab at My.math. Notify the instructor of discrepancies immediately.

Department of Mathematics, PO Box 643113, Neill Hall 103, Washington State University, Pullman WA 99164-3113, 509-335-3926, Contact Us