Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

You are an Internet messenger (a somewhat fictional entity, but it will make for

ID: 3685479 • Letter: Y

Question

You are an Internet messenger (a somewhat fictional entity, but it will make for an interesting story) who carries messages around the network. In the network below, a user turns on Computer A, starts a web browser, enters a URL to his favourite web site http:// www.widgetsrus.com. The web browser asks you, the messenger, to carry a request to the web server and then carry a response back to the user. Your journey will take you into the caverns of the Internet as shown in the diagram below carrying the user’s request. The server – at Computer B – warmly receives you and formulates a reply to the request which you transport back to the user at Computer A. You should consider what happens at Computer A in the web browser, what happens to the message down through the stack layers, what happens to the message as it is sent across a wired Ethernet link. What does the switch do and which network layers are involved. What do the routers do and which layers are involved at the routers. How do the switches and routers process (manipulate) the packets? What fields do they look at, and which fields are changed? You only need to report in detail your experience at router 1 and router 2 – it will be much the same for routers 3, 4, and 5. Computer A Router 1 NETWORK 1 Router 2 Computer B NETWORK 2 Router 3 Router 4 Router 5 What happens to the message you are carrying at the web server on Computer B? How is the reply constructed and do you return it to the user in the reverse process. Where information is the same as in the outward journey, you need not repeat it. We have not done everything in detail in the lectures yet, but you should aim to get a feeling for how all messages are processed in the network, and the slightly different terminology used at each stack layer. This will help you to place the detail we give in lectures and what the fields in the packet headers are used for. You can write this as a story – but it must be a very interesting story. Better still would be presentation in tabular form so that the reader can see what you have found out at a glance. You should present the encapsulation and decapsulation of the messages at each node that the message passes through. This answer will most likely take 3 to 4 pages.

Explanation / Answer

Hubs

A hub is typically the least expensive, least intelligent, and least complicated of the three. Its job is very simple – anything that comes in one port is sent out to the others.

If a message1 comes in for computer “A”, that message is sent out all the other ports, regardless of which one computer “A” is on:

And when computer “A” responds, its response also goes out to every other port on the hub:

Switch

A switch does essentially what a hub does, but more efficiently. By paying attention to the traffic that comes across it, it can “learn” where particular addresses are.

Initially, a switch knows nothing and simply sends on incoming messages to all ports:

Even accepting that first message, however, the switch has learned something – it knows on which connection the sender of the message is located. Thus, when machine “A” responds to the message, the switches only need to send that message out to the one connection:

In addition to sending the response through to the originator, the switch has now learned something else – it now knows on which connection machine “A” is located.

That means that subsequent messages destined for machine “A” need only be sent to that one port:

Switches learn the location of the devices that they are connected to almost instantaneously. The net result is that most network traffic only goes where it needs to rather than to every port. On busy networks, this can make the network significantly faster.

Router

A router is the smartest and most complicated of the bunch. Routers come in all shapes and sizes – from the small, four-port broadband routers that are very popular right now to the large industrial strength devices that drive the internet itself.

A simple way to think of a router is as a computer that can be programmed to understand, possibly manipulate, and route the data that it’s being asked to handle. Many routers today are, in fact, little computers dedicated to the task of routing network traffic.

As far as simple traffic routing is concerned, a router operates exactly as a switch, learning the location of the computers on its connections and routing traffic only to those computers.

Consumer grade routers perform at minimum two additional and important
tasks: DHCP and NAT.

DHCP – Dynamic Host Configuration Protocol – is the way dynamic IP addresses are assigned. A device asks for an IP address to be assigned to it from “upstream” and a DHCP server responds with an IP address assignment. A router connected to your ISP-provided internet connection will typically ask your ISP’s server for an IP address; this will be your IP address on the internet. Your local computers, on the other hand, will ask the router for an IP address and these addresses are local to your network.

NAT – Network Address Translation – is the way that the router translates the IP addresses of packets that cross the internet/local network boundary. When computer “A” sends a packet out, the IP address that it’s “from” is that of computer “A” – 192.168.1.2 in the example above. When the router passes that on to the internet, it replaces the local IP address with the internet IP address assigned by the ISP. It also keeps track, so that if a response comes back from somewhere on the internet, the router knows to do the translation in reverse – replace the internet IP address with the local IP address for machine “A” and then send that response packet on to machine “A”.

A side effect of NAT is that machines on the internet cannot initiate communications to local machines – they can only respond to communications initiated by those local machines.

The net effect is that the router then also acts as a firewall:

What that means is that malware that might spread by trying to independently connect to your computer over the network cannot.

Routers use the IP layer (layer 3) and switches use the data-link layer (layer 2). Layer 1 is the physical 1s and 0s that go over a wire, Layer 2 is the data-link layer, which is protocols like Ethernet and Point-To-Point Protocol (PPP), which carries information between adjacent nodes about MAC address from and to and allows for error detection and retransmission. Layer 3 is the IP layer, which carries information about where in the whole network the packet is from and to, not just the current hop.

The transmission would go like this:

Machine A wants to send a packet to Machine B. Machine A knows Machine B's IP address, so it places that in the layer 3 packet. Machine A needs to place the MAC Address of the next hop in the layer 2 packet, however. If it does not know, then it will send something called an ARP request to the network, with the destination IP. One of a few things will happen here:

If Machine A found this out earlier, it will be in the ARP cache and Machine A will just use that.) Now that the MAC address is sent, the packet can be transferred (the physical layer 1 performing the actual transfer of data on the wire. The next stop will be the switch. The switch knows which outbound port the MAC address listed as the layer 2 destination is on, because it tracks every MAC address it's seen a packet come from and which port it came on - if it does not know, then it will flood it out every single port, guaranteeing it'll arrive.

As such, the packet arrives at the router. The cool thing about the IP model is that it divides every single IP address in the network/world into a hierarchy - Subnets by definition cannot overlap subnets partially, they either wholly contain them or are wholly contained by them. So as long as subnets follow this hierarchy, the router can unambiguously determine where each of the 4 billion possible IP addresses are on the network just by looking at what subnet the IP will fall under in its table! The packet is then sent out that port.

As the packet travels through interconnected ISPs' routers, backbone infrastructure and so on, it arrives at Machine B's router, where the opposite process happens - router B sees that its destined for Machine B and sends it inbound. Similarly, Router B will have to use a process like ARP to find Machine B's MAC address if not known. The rest should be trivial from here.