 Your routing tables. Let's look at some of the answers for the routing tables. We've done R2 Okay, I think we did R2 in the lecture For router R3 for example To reach subnet 2.2.0.0 Slash 16 send direct Y Bring back our network from R3 To reach subnet B We are directly attached to subnet B. There is no next router in this case If we're R3, and let's say there's a host H6 on subnet B To send the H6. I don't send to a router. I send direct to H6 using the LAN technology So that's what we say when we say direct. I mean, there's no next router send using a LAN cable or send via the switch inside the the subnet B direct to H6 So for router 3 anyone on subnet B send direct In fact anyone on a subnet that we're directly attached to send direct subnet B, C and D From R3's perspective we can send direct B, C and D send direct subnet A The one to the left we need to send a router with IP address 2.2.1.1 and So to send to subnet A send a router 2 interface 1 to send to F, G and E We send a router 4 interface 0 and Importantly we don't even need to have three separate routes there. We could have routes to F That is we could have an entry to F Send to R4 0 to G send to R4 0 and to E send to R4 0 You can have three entries for those but we often want to simplify the routing table keep it as few rows as that as possible and The way that these IP addresses are structured for F and G They are subsets of the subnet address for E That is the subnet address for E is 3.3 Dot 0 dot 0 slash 16 the first 16 bits corresponded decimals 3.3 So anything That starts with 3.3 really is within the subnet E The way that I've designed this example is that F and subnet F and subnet G are actually within subnet E Because they both start with 3.3 So this is a special case where we're actually splitting one subnet into further subnets So we have our internet we split it into subnets But we've done it at another level here. We've split subnet E into further subnets The way that the addresses are structured they both start with 3.3 so they we can think they both children or within subnet E Why do that? It makes the routing much simpler because we just need one route now To reach anything that starts with 3.3 That is subnet E and any of its subnets within that send a router for interface 0 3.3 dot 0 dot 0 slash 16 send a 2 2 1 3 just one entry is needed there anyone else That don't that doesn't match the other rows send a 2 2 1 5 That's the way to interpret the star value here any other value send to router 1 now the star value Actually the real way to interpret it is it's 0 dot 0 dot 0 how many four zeros slash zero We'll come back to that when we see our packet Structure and see how it's forwarded forwarded throughout routers Router 4 and 5 Well similar router 4 We can send A route to subnet a c and e a route to subnet f and g Directly attached to b and e and everyone else send via router 1 and Subnet 5 Directly attached to e and f everyone else R4 Interface 1 so router 4 and router 5 router 5 is quite simple because We need the two directly attached subnets We need to get to Is it subnet g and everyone else sends via the router on subnet e Any questions on the routes for the routers? Hosts also need routes. They need routing tables But often they are very simple because usually a host is only attached to one subnet for host one To reach anyone on subnet a Send direct To anyone on subnet c send a router to interface zero subnet b router to interface zero e f g d router to interface zero Anyone on the internet of the millions of subnets still router to interface zero So in fact for a host normally we have two entries one for our local directly attached subnet and one for a default route to the rest of the world Because there's only one possible router we can send to similar for hosts to So hosts normally have simple routing tables now I want you to consider that we have a route a web browser on h1 and a web server on h2 and h2 is running a web server What port number would the web server be using web servers use port? 80 What port number is my browser using? We don't know Browsers or clients commonly use dynamic port numbers. It's assigned by the operating system But for this example, I'll tell you let's say the operating system assigned 50123 Can be a different number, but easy one we know the IP addresses of h1 and h2 I Want you to draw the packet structure for the request the HTTP request sent from h1 to h2 That is I've typed in the domain name or the IP address and I've pressed enter and eventually my browser sends a HTTP message to the server via the route R2 R3 To h2 for the packet sent from h1. What's it look like? That's your task The HTTP request sent by h1. Well the hint. There's four Four protocols in use here We can think that the application generates a message using the protocol HTTP so What I'll draw is that the application message we're using HTTP includes some data but that HTTP message is not sent directly. It's sent using a transport protocol Which one and that transport protocol sent using a network layer protocol, which one put the names in and Then for those Particular headers there are some fields which I want you to fill in the address fields especially fill those in we know that The HTTP message HTTP we've seen it in some previous examples uses TCP as a transport protocol HTTTP HTTP requires reliability TCP is the transport protocol that provides reliability retransmissions So the HTTP message is input inside a TCP segment So you can think that the TCP packet is all of this The header is here the payload is the HTTP message But before we send that we actually use another protocol to send the TCP packet. We use the internet protocol IP So we attach an IP header This is the IP Header This is the IP payload the data we put inside the IP datagram. We put one inside another and In our example, we're using on all of our LANs the data link layer is ethernet I'll just write eth for ethernet This is the entire ethernet frame Inside the ethernet frame we have an ethernet header and Inside that we have an IP datagram that the payload of the ethernet frame is the IP datagram The payload of the IP datagram is the TCP packet The payload of the TCP packet is HTTP message We put one inside the other so Each of the headers have some fields. We're not going to go through all the fields, but just the addressing fields The TCP header contains a source port and a destination port this is sent by my web browser To the web server Web server easy destination port 80 Web browser we gave it to you. It may be different. I Chose my web browser to use 50123, but in a different case. It may be a different value It's a dynamic port from about 49,000 up to 65,000 so Set it to 50,000 123 The IP header contains a source IP address destination protocol number. What are their values? What's the source IP address? This is sent by h1 destination h2 the IP addresses identify the original source and the final destination that is h1 to h2 Your IP addresses may be different, but I chose h1 to be 1.1.1.27 and 4.4.1.156 for h2, so I'll use those values The protocol number tells IP what's inside the payload What transport protocol is inside the payload? Well, we can see easy. It's TCP But we don't specify TCP. We use a number to indicate TCP. The number is Everyone yell it out at once What's the number for TCP? Magic number It's on the previous some of the slides TCP is allocated the number six Each transport protocol has a unique number TCP is six UDP is 17 ICMP is one and there are many others So the value of the field here would be six Meaning It's TCP What's inside IP? TCP the ethernet frame sent by h1 What's the source address? Well, it'll be the address of h1. It's not the IP address This is at the data link layer. We use a different type of address in ethernet. We use a MAC address sources h1 The ethernet or MAC or sometimes hardware address of h1 is this f4 f5 f6 address You can write the full one. I won't fit it in maybe I can fit it in one Six five four three two one So the ethernet frame is for sending just inside the LAN What's the destination address the hardware address of which device or interface? the Source is the hardware address of h1 The LAN is only subnet a so we're sending to R2 interface zero So the hardware address is not that of h2 We from ethernet's perspective. We're only using it for internal communications on this subnet We know nothing about the LAN technology used by h2 To communicate across multiple subnets. We're using IP for that for ethernet. It's only internal in the subnet So we're sending from h1 to R2 interface zero. We know because of our routing table our routing table tells h1 to reach 4.4.1.156 you need to send a R2 interface zero So the Hardware address of our frame will be that of R2 interface zero this one two three four five six address so be careful there that the ethernet frame is just for the The source in the subnet to the destination in that same subnet. It's not the final destination It's the next one in the path the type field in the ethernet header Is similar meaning to the protocol field in the IP header? The protocol field in the IP header tells us what's inside TCP is inside The type field tells us what's inside the ethernet frame IP is inside and IP has its own number as well and it's not I think on any of the slides It's number eight meaning IP is inside this ethernet frame. So that's the frame sent by h1 Where does it go to? Well from the routing table will go to R2 interface zero When it arrives at R2, let's look at the routing Table for R2 Know the destination IP address four four one one five six It gets the R2 R2 gets it. I'm not the destination. This is R2. It's not destined to me It's destined to someone else. So we look up the routing table Which field does it match? Which road does it match in the routing table? Well the destination four four one one five six It doesn't match this now to check a match The Destination IP address must match the first 16 bits of this address right we have four four one one five six you can convert to binary But I think you can see that the first 16 bits of one one zero zero and four four one five six are not the same So it doesn't match this one and again the first 16 bits of the second address must match No, it will not for this road to match the first 24 bits must match 4.4.1 are the first 24 bits. Ah, we have 4.4.1. So yes, that is a match But we we check the others as well. We may have multiple matches 4.4.2 The first 24 bits are different than 4.4.1 So no, it doesn't match 3.3 will not match the first 16 bits. What about this to star match Does 4.4.1.156 match anything? Yes, it is any value it matches anything. So yes, it does match there and the way to think well the actual way that star is implemented. It's actually a special address of all zeros slash zero and it's a bit confusing because what it means the all zeros Zero values must match So that's what mean anything means nothing matches mean anything will match. So zero values must match Well, yes, there are zero or more values that match therefore it will always match this address So 4.4.1.156 does match all zeros Or at least zero of the bits match So yes Does it matches this row? So in this case we have two rows that match Which one do we use? We use the one with the most bits that match on the left 4.4.1.256.4410. There are at least 24 bits from the left that match Zero and four There are less than eight bits that match Therefore the one with the longest prefix that matches is that first row that we found In other words, this one has 24 bits that match. This one has zero bits that match use this one So our next router is 2.2.1.2 Now that's the details of how it works, but often it's very easy to see all right 4.4.1.156. Yes, it's this one well We only use the default route if none of the others match That's what it ends up happening If we get a match use that If the routing table is designed correctly if we don't use the default route We send to 2.2.1.2 We will not draw it But the next question that you have on your sheet is this packet received by H2 The same packet it goes via the routers and eventually gets to H2 When from H1 to R2, R2 send to R3 and then R3 sends to H2 For that packet that arrives at H2 What does it look like? Well It looks exactly the same. It's the same packet What has changed? We're still using the same source and destination port that doesn't change IP addresses don't change. We're still using TCP that doesn't change the thing that does change is the Ethernet source and destination address So the second packet that you supposed to draw is exactly the same except the source address will be that of the router The destination address with the Mac or hardware address of H2 So the only thing that changes are these hardware addresses along the way I will not draw that because I have the answer here save me time. This was The packet we just drew Okay, we've drawn that one. This is sent by H1 if we looked at the same packet but received at H2 Looks exactly the same Except the source and destination hardware addresses That's the only thing that's different there. This would be the source address of the router R3 is it the router R3 and the destination will be that of H2 again This packet is coming from R3 interface 1 going to H2 So we'd use those hardware addresses there and we'd get the packet received by H2 Everyone got answers for those two, okay The last two packets are some special cases just to show that not everything's so easy And I'll show you the answers will not go through or just explain to finish today first Now DHCP client. What's DHCP? DHCP is used for your device to discover an address if it doesn't yet have one First thing to notice DHCP is an application layer protocol It uses UDP as a transport layer Just to show a different case and the port number is used is also a special case you TC TCP is not used but UDP also uses port numbers and For DHCP the server port number is fixed at 67 Unlike web browsing where the client port number changes. It's fixed with DHCP 68 So I had to look those up to find those exact values You don't need to remember them But note that sometimes they are fixed for both client and server The protocol number for UDP is 17 When we're sending a packet with DHCP, we don't know our IP address We want to discover one So we set the source to this special address of all zeros I don't have an IP address. I want to send a packet. So the source must be set to something. I set it to all zeros Who can I send it to if I know nothing about the computers? There's only one place I can send it send it to everyone I don't know the router. I don't know other servers the hosts because I've just booted my computer So I send it to the local broadcast address this 255 address With the idea someone will get it and respond telling me my IP address That's the idea Source address in the ethernet is my Mac address and Here's a special one which we Didn't intend to cover but it comes up to send to everyone on the ethernet land. There's a special Hardware address all f's or all binary ones. That's not one to remember. We will not cover that in the exam We'll see it next semester in the lab just another case different transport protocol the case of the special IP addresses being used and the last one Ping because I know everyone use ping a lot in the assignment and you want to know how it works Ping is another special case It uses that what we call the transport protocol ICMP There is no application layer protocol. It's again special in this case. There are no port numbers with ping So unlike TCP and UDP it doesn't have port numbers. I Want to ping everyone on subnet F? I am the source H1 The destination is the directed broadcast address for subnet F 3331 255 and the protocol number for ICMP is one The way that this ping packet would be sent the ping packet will be sent if from H1. I Wanted to send to everyone on Subnet F. I would send one copy to R2 R2 would use its routing table to send to R4 R4 would use its routing table to send to R5 Then R5 would recognize that the destination is the director broadcast address and send to everyone It depends on how many are there So directed broadcasts send a single copy all the way to the final router that delivers to everyone on that subnet That's the concept of director broadcast So I could ping everyone on subnet F in theory So the source MAC would be mine Sorry, the second router The second router is R4 in the path the second router R4 The source would be R4 1 the destination R5 0. That's where I got those hardware addresses from those last two are just some special cases to illustrate different addresses and I think that's sufficient for today. We're out of time and we've got to the end of our lecture and the end of our course so well done for surviving to the end hopefully you survive all through through the exam and We will hopefully see you next semester We will do some of this in a lab and maybe you'll study some more details in another lecture course on computer network architectures