FIT1047 Tutorial 10 – Sample Solution Topics and goals
Network & Transport layers and protocols, Address resolution in networks • Routing
• Static & Dynamic Routing
• TCP connection Oriented protocol
• Network address resolution
• TCP/IP: understand how subnets and routing tables work
Task 1: Routing
1. Define a router and routing in networks?
Routers is a layer 3 device, it connects dissimilar networks, Internet is a network of networks and routers are used to interconnect them. It’s the most important piece of Internet infrastructure. Routing is the process of transferring the packets from one network to another network and delivering the packets to the hosts. The traffic is routed to all the networks in the internetwork by the routers. In the routing process a router must know following things:
• Destination device address: Routers use IP address header information to determine where the packet is sent next.
• Neighbor routers for learning about remote networks.
• Possible routes to all remote networks.
• The best route with the shortest path to each remote network.
A router’s interface has one IP address per interface, i.e. typically per network subnet it is connected to.
2. Compare and contrast the static & dynamic routing?
Routing algorithms in the context of networking can be classified based on Distance vector and link state algorithms. Here we compare and classify based on the building and modification of a routing table in a router. This can be done in two ways statically or dynamically. More precisely these are known as static and dynamic routing respectively.
Static routing: In the Static routing, the table is set up and modified manually.
• Network manager prepares fixed routing tables
• Manually updated when the network changes
• Used in simple networks that don’t change a lot
Dynamic routing: whereas in the Dynamic routing the table is built automatically with the help of the routing protocols. Dynamic routing is preferred over static routing because of the major issue in static routing where in case of link/node failure the system cannot recover. The dynamic routing overcomes from the static routing limitations.
• Routers exchange information to build routing tables dynamically
• Initial tables can be set up by network managers
Page 1 of 3
3. Compare Distance vector and Link state routing algorithms?
In Distance Vector routing, each router knows, for each destination network, the distance (in number of hops) to reach it, and the direction (the vector) where it must send packets for that network (i.e., the interface). It then uses that information to build a routing table automatically. In RIP routing, each instance where a packet goes through a router is called a hop, and the route with the least numbers of hops to the network will be consider as the best one.
Link state routing is the other type of routing protocols. While distance vector routers use a distributed algorithm to compute their routing tables, link-state routers exchange messages to allow each router to learn the entire network topology. Link state routing is a complex routing technique in which each router shares information with other routers about the reachability of other networks and the metric to reach the other networks in order to determine the best path. not just routing table (best routes) but all of the network it knows about use a metric (usually link speed) to describe the quality of each connection.
4. What is meant by ‘connection-oriented’ protocol?
In ‘connection oriented’ protocol, a logical connection is established prior to data transfer using 3-way TCP handshake, all the packets follow the same route (unless the initial route fails and a new route is established) and arrive at destination in order. After the completion of data transfer, the connection is terminated using a four-way TCP handshake.
5. Explain Application layer address resolution & Data Link Layer address resolution?
Application layer protocol use DNS (Domain Name System) for address resolution. Client sends request to DNS server to get IP address registered for a domain name in DNS Servers. DNS is Implemented as a distributed database of names and are organized in a hierarchy reflecting the structure of the domain names. Before a message can be sent, we must know the destination address. It is extremely important to understand that each computer has several addresses, each used by a different layer. One address (MAC address) is used by the data link layer for frames, another address (IP Address) by the network layer, and another (Domain Address) by the application layer.
When users interact with applications, they use the application layer address. When a user types a Domain address into a Web browser, the request is passed to the network layer as part of an application layer packet formatted using the HTTP protocol. The network layer in turn, uses a network layer IP address. The network layer protocol used on the Internet is IP, so this Web address (www.google.com.au) is translated into an IP address that is 4 bytes long when using IPv4 (216.58.199.67).
The network layer then determines the best route through the network to the final destination. On the basis of this routing, the network layer identifies the data link layer address of the next computer to which the message should be sent. If the data link layer is running Ethernet, then the network layer IP address would be translated into an Ethernet address. Next topic shows that Ethernet addresses are six bytes in length, so a possible address might be F0-6E-0B-D7-C6- 11 (Ethernet addresses are usually expressed in hexadecimal).
Task 2: Subnets and masks
Each IP address identifies one particular device (or more precisely, one network interface of one device). But IP addresses have structure: a certain number of bits are used to identify the
Page 2 of 3
subnet that the device belongs to, and the remaining bits identify the concrete device in that subnet.
We use notation such as 130.196.13.5/24 to denote that the first 24 bits identify the subnet. In this case, it means any device whose IP address also starts with 130.196.13. belongs to the same subnet. This is important: Let’s say 130.196.13.5 wants to send a message to 130.196.13.32; it can just look at the IP address to know that the destination is in the same subnet, which means that it can send the message directly. But if the destination is, e.g., 130.196.42.3, the IP address tells us that it’s in a different subnet, so we have to send the message to our router.
We call /24 the subnet mask. An alternative notation, called “dotted-decimal”, is 255.255.255.0, which when written in binary is simply a sequence of 24 ones, followed by 8 zeroes:
11111111.11111111.11111111.00000000
The subnet address (which identifies the subnet) can be obtained by replacing the host part of an IP address with zero bits. E.g., the subnet address of 130.196.13.5/24 is 130.196.13.0/24.
1. Writethesubnetmask/22using“dotted-decimal”notation. 255.255.252.0
2. Write the subnet mask 255.255.0.0 using “slash” notation. /16
3. Give the subnet address for 192.168.131.3/18. Are 192.168.131.3/18 and 192.168.155.42/18 in the same subnet?
Let’s start by writing the IP address in binary:
11000000.10101000.10000011.00000011
To compute the subnet address, we need to take the leftmost 18 bits of the IP address and replace the rest with zeroes:
11000000.10101000.10000000.00000000
Converting this back into decimal, we get the subnet address 192.168.128.0/18.
In order to check if 192.168.155.42/18 is in the same subnet, let’s write it in binary notation:
11000000.10101000.10011011.00101010
We can see that the first 18 bits are the same, so the two addresses are in the same subnet.
4. Are192.168.211.3/18and192.168.155.42/18inthesamesubnet?
Let’s write 192.168.211.3/18 in binary:
11000000.10101000.11010011.00000011
Comparing the first 18 bits, we can see that there’s a difference: bit 18 is 1, whereas it’s 0 in 192.168.155.42/18. So, the two IP addresses are not part of the same subnet.
Page 3 of 3