Placeholder Image

字幕列表 影片播放

  • So let's say we haven't Ethernet network here, and there are four computers here connected to a switch.

  • And so any each of these computers has a Mac address, and any of the computers can send frames to any of the other computers just by addressing it to the appropriate Mac address.

  • And we also talked about point to point links eso here.

  • Each of these computers can send frames over these PPP links to whatever they're directly connected to.

  • So, for example, this device here in San Francisco consent frames to Seattle or to Denver.

  • But it can't send frames to New York because it doesn't have a direct PPP link to New York.

  • So what if we we do want to actually send information from San Francisco to New York?

  • Is there some way we can forward that information through through Denver?

  • Here on Dhe, Have it pass it along.

  • And what if we actually wanna let's say, connect our Ethernet network over here in San Francisco to this device?

  • And let's say we have another Ethernet network over in New York over here, and we want to connect that a CZ well over here.

  • So the interesting question now is like, how do we send information from a computer on on this?

  • Either net segment here in San Francisco to another computer all the way over here on this either net over here in New York.

  • So help us explore this a little bit more.

  • I've redrawn this scenario down here, um, in a little bit more detail.

  • So we've got her Ethernet network over here on the left, and this is this is a multi point link here.

  • So I've shown all the computers connected, you know, to this vertical line just to kind of show that any of them can send frames to any of the other ones that air that are connected to this network.

  • Then we have the other Ethernet network over here on the right.

  • And what we want to dio is ah, be able to send a frame from this computer over here.

  • Let's call it host A to this other computer over here on the right, which will call host be now, both of these computers air using Ethernet.

  • So one question you might you might want to ask is what happens if this computer over here host a just sends a frame with with host bees.

  • Mac, address as the destination.

  • What would happen is that frame would get sent on this Ethernet.

  • But none of the device is connected to this Ethernet here.

  • None of these devices have host bees, Mac address.

  • So none of these other devices have that Mac address.

  • So all of them are just gonna ignore Ignore that frame if Host A sends an Ethernet frame with the destination of B because it's not going to go beyond this Ethernet.

  • So is there some way to get this device here?

  • This this device in San Francisco Thio forward that frame over the PPP link.

  • Well, if we just did that, then we'd actually run into another problem.

  • Because remember, PPP doesn't use Mac addresses the way that Ethan it does.

  • So when this frame got to Denver, then it wouldn't have that destination Mac address in it anymore, because that was only on this infinite.

  • So we just take that frame, stick it into P p p p p p doesn't have a destination.

  • Mac address eso Denver gets it in Denver is not gonna know what the destination is.

  • So Denver's not gonna have any idea what to do with the frame.

  • So what we need is some other type of address that isn't specific to either dead or isn't specific to PBP that we can use across this entire network.

  • So if Host be has some sort of universal address that it's understood everywhere, then all of these devices in the middle of these these routers in the middle here I would be able to use that address to forward data to the right place.

  • And so the address that we use is called an I P address or Internet Protocol address.

  • Internet protocol for I P address and the word Internet literally means enter or between networks.

  • And so the Internet Protocol and I P addresses are exactly what we would use to send information between networks, which is what we're trying to do from this network to this network.

  • And so what these I P routers do is they're connected to multiple networks and there's some frames arriving here.

  • Let's say on interface one of this San Francisco router and inside those frames is A is a packet of data with a destination I p address, and so the routers job is to look at that destination address and decide whether the package should be forwarded out this interface or this interface.

  • And so if it decides to forward the packet out interface three, let's say then it will encapsulate that I p packet inside a PPP frame then and send it on to the next router over here.

  • And then the Denver router will do the same thing.

  • It'll look at the packet inside the PPP frame, look at the destination i p address and decide which of these interfaces it's gonna forward it out of.

  • So that's what writers do.

  • They receive packets on each other, interfaces on, make a decision about which other interface to forward them out of.

  • And so that's the process of forwarding.

  • And so for that, to work, each router needs toe have what's called a forwarding table that tells it how to get to each destination.

  • So, for example, this router in San Francisco needs to somehow learn that to get to the I p address for this host over here in New York, it should forward the packets out interface three and not interface to or somewhere else.

  • And so the process of building that table is called routing.

  • On the process of actually using the table to forward packets is called forwarding.

  • So the addresses we we normally use for I p r.

  • 32 bits long.

  • And there's also I p Version six, which uses 128 bit addresses.

  • But Internet is still predominantly using version four, which which uses the 32 bit addresses.

  • So with with 32 bits there, that means there's about two to the 32nd possible addresses if she's about four billion possible addresses.

  • So you might imagine that each of these routers have a forwarding table with up to four billion entries, one for each i p address, saying, You know, to get to this address, go out this interface or go out that interface, and in principle we could do that.

  • But four billion entries is in the 14 table that we have to look through for every packet That's forward is an awful lot.

  • So what we can do is instead of listing every address individually, we can weaken group ranges of addresses together by prefix.

  • So maybe the I p address of this computer over here in New York is say 1 72.17 dot six dot too.

  • Um so Denver, for example, could have a route in its forwarding table that says to get to the prefix 1 72 dots 17 slash 16 will explain what that is in the moment.

  • Go out in her face, too.

  • And so when Denver receives, ah, pack it with a destination of this 1 72 to 17.

  • 62 it doesn't have to have that exact address in its forwarding table.

  • It could just match this prefix.

  • And so this slash notation here, this slash 16 tells us the prefix length.

  • So the 16 after the slash means that this route here, this 1 17 17 matches the 1st 16 bits of the address.

  • So if the router receives an address of the 1 72 to 17.62 um, or a packet with that as a destination, the router will be will be comparing us in binary.

  • So what?

  • This isn't binary.

  • The 1 72 is C 10101100 That's 1 72 and then 17 is gonna be 00010001 The 600000 are running out of room.

  • Let me just move this over.

  • Make myself a little bit more room.

  • Oops.

  • Here we go.

  • And so six is 0110 and two is 000010 Sorry.

  • That doesn't quite fit.

  • But so this is This is 17 to about 17.

  • 62 here in binary.

  • So since the prefix length is 16 that means that the this prefix, this 1 72 about 17 will only be compared against the 1st 16 bits of this address, which is just up to here.

  • This is the 1st 16 bits, which is just the 1 72 17 part.

  • So we could just kind of ignore the six dot to the last 16 bits of the address.

  • Just ignore the rest of the address because, um, this prefix matches the first part.

  • And that's enough to know that we should forward out interface too.

  • So we should forward that packet that way.

  • Now, in reality, this forwarding table probably have a bunch of different entries.

  • So maybe we also have a no entry for 1 72 20 slash 16 which says go out in her face.

  • One or maybe we also have a route for 1 72 17 0.6 slash 24 which says Go out interface three and maybe another route that says 1 72 17.8 slash 24 go out in her face.

  • Three as well on and so forth.

  • So maybe there's more entries here.

  • It's not what it does when it's looking up.

  • Destinations in this table is it picks the longest matching prefix.

  • And so for this 1 72 17.6 stuck, too.

  • Both of these entries match right 1 70 about 17 matches as well as 1 72.17 dot six also matches.

  • And so, um, because it matches both of these, what it'll end up doing is it'll end up choosing this one here because this is the longer match.

  • It's 24 bits instead of 16.

  • Um, and so in this scenario, the packet would actually get forwarded out Interface three.

So let's say we haven't Ethernet network here, and there are four computers here connected to a switch.

字幕與單字

單字即點即查 點擊單字可以查詢單字解釋

B1 中級

互聯網協議 | 網絡教程 (8 of 13) (The Internet Protocol | Networking tutorial (8 of 13))

  • 8 1
    林宜悉 發佈於 2021 年 01 月 14 日
影片單字