Presentation is loading. Please wait.

Presentation is loading. Please wait.

Ethernet switch Hosts Can talk using Ethernet addresses only.

Similar presentations


Presentation on theme: "Ethernet switch Hosts Can talk using Ethernet addresses only."— Presentation transcript:

1 Ethernet switch Hosts Can talk using Ethernet addresses only

2 Ethernet switch Hosts Can talk using Ethernet addresses only Ethernet switch Hosts

3 Ethernet switch Hosts Ethernet switch Hosts Router Assign IP addresses A B C A  B, want communication using Ethernet addresses only A  C, via router So, use router interface’s Ethernet address

4 Problem How to tell A that B is reachable using the local Ethernet, while C is not? How to tell A that B is reachable using the local Ethernet, while C is not? Interface subnet mask (also just “mask”) Interface subnet mask (also just “mask”) Assigned at configuration Assigned at configuration

5 Using the mask A does a bit-wise AND of its interface IP address and mask A does a bit-wise AND of its interface IP address and mask Result: identification of own network [say x] Result: identification of own network [say x] For any host H with dest IP addr DA For any host H with dest IP addr DA –DA & mask = y [say] IF x = y, A thinks H is on its own network IF x = y, A thinks H is on its own network

6 Using the mask IF x = y, A thinks H is directly connected IF x = y, A thinks H is directly connected If x not equal to y If x not equal to y –A talks to H via router –A thinks H is indirectly connected

7 Implications If A thinks H is directly connected to it If A thinks H is directly connected to it –then A attempts to find Ethernet address of H If A thinks H is indirectly connected to it If A thinks H is indirectly connected to it –then A attempts to find Ethernet address of router interface

8 Observe… In either case, actual packet transfer uses link layer frames In either case, actual packet transfer uses link layer frames Directly connected  Link layer dest addr = link layer address of host Directly connected  Link layer dest addr = link layer address of host Indirectly connected  Link layer dest addr = link layer address of router Indirectly connected  Link layer dest addr = link layer address of router

9 Re-iteration Directly or indirectly connected Directly or indirectly connected –From a host’s viewpoint IP level (logical) notion IP level (logical) notion Must consider Must consider –Host interface address –Host interface mask –Destination machine’s interface address

10 IP addr to link addr How to find link layer addresses from IP addresses? How to find link layer addresses from IP addresses? Address Resolution Protocol (ARP) Address Resolution Protocol (ARP) Query: “Who has 10.114.1.25”? Query: “Who has 10.114.1.25”? Queries are broadcast Queries are broadcast Machine with IP address 10.114.1.25 sends an ARP reply, supplying Ethernet address Machine with IP address 10.114.1.25 sends an ARP reply, supplying Ethernet address

11 Directly connected host X Directly connected destination X – ARP for X Directly connected destination X – ARP for X Indirectly connected destination Y – ARP for R Indirectly connected destination Y – ARP for R Direct and Indirect Routes IP address of XLayer 2 address of XDataIP address of YLayer 2 address of RData

12 10.3.3.2 / 2410.3.3.3 / 24 10.3.2.2 / 24 10.3.2.3 / 24 10.3.2.1 / 24 10.3.3.1 / 24 Single physical network but 2 logical subnets

13 140.252.13.33.13.66.13.65.13.35.13.34 Ethernet PPP ABCD Mask = 255.255.255.224 or / 27 B wants to send pkt to A; directly connected? B wants to send pkt to D; directly connected?

14 Variable length subnet masks 140.252.1.29 140.252.13.33 B Subnet mask: 255.255.255.0 Subnet mask: 255.255.255.224 On different interfaces, subnet masks of different length

15 Special IP addresses Diskless X terminal Server Want to get boot file from a server

16 Special IP addresses The diskless ws downloads the bootstrap file name from a server, and then the file The diskless ws downloads the bootstrap file name from a server, and then the file No IP address, no subnet mask available initially No IP address, no subnet mask available initially –Perhaps no fixed IP address for this machine –To be obtained dynamically But the IP network must be used But the IP network must be used

17 Special IP addresses Protocols: “BOOTP” and “TFTP” Protocols: “BOOTP” and “TFTP” BOOTP  The name of the bootfile BOOTP  The name of the bootfile TFTP  To transfer the file TFTP  To transfer the file BOOTP UDP IP Eth TFTP UDP IP Eth

18 Special IP addresses Special IP addresses What should be the source and destination IP addresses in the BOOTP andTFTP requests? What should be the source and destination IP addresses in the BOOTP andTFTP requests? 0.0.0.0 0.0.0.0 –Valid source address; never a dst address –Used when the sender does not know its addr

19 Special IP addresses How does a server send its reply to the host that sent the query? How does a server send its reply to the host that sent the query? Uses link layer (e.g., Ethernet) address Uses link layer (e.g., Ethernet) address The query arrived in an Eth frame The query arrived in an Eth frame Host’s Eth address: in Src Eth address of frame Host’s Eth address: in Src Eth address of frame

20 Other special IP addresses 255.255.255.255 255.255.255.255 –Valid destination address: “limited broadcast” –Never a source address –Never forwarded by a router beyond the physical network in which the router is present

21 Other special IP addresses 127.x.y.z 127.x.y.z –Valid source and destination address –Loopback interface address

22 More special IP addresses Net-directed broadcast address Net-directed broadcast address –Netid and hostid –Set the hostid bits to 1 Subnet-directed broadcast address Subnet-directed broadcast address –Netid, subnetid and hostid –Set the hostid bits to 1

23 Routing Table Each machine, whether end-host or router, has a routing table in the kernel Each machine, whether end-host or router, has a routing table in the kernel This table is consulted every time a packet has to be sent out This table is consulted every time a packet has to be sent out The table provides information on the next-hop IP address, the outgoing interface etc The table provides information on the next-hop IP address, the outgoing interface etc

24 Routing Table Typical entries Typical entries –Destination network (netid or net-subnetid) or host  Note: This “destination” is the name of a column in r. table, not in packet –Routing table mask –Next-hop IP address (often denoted as “gateway”)

25 Routing Table –Outgoing interface –Flags to indicate whether  destination address (in table) is a network/host address  destination (in table) is directly connected

26 Routing Table DestMaskG/wFlagsIntfc S.A.D.A. Different things

27 Routing Table: Basic Operation Pick up the packet’s destination address Pick up the packet’s destination address Apply the routing table mask Apply the routing table mask The network-prefix of the packet’s destination address is extracted The network-prefix of the packet’s destination address is extracted Now match this extracted id with entries in the column named “Destination” Now match this extracted id with entries in the column named “Destination”

28 Routing table (contd) If match is seen, obtain the next hop address from the “Gateway” column If match is seen, obtain the next hop address from the “Gateway” column Flags: Flags: –H present  “Destination” column represents a host –H absent  “Destination” column represents a collection of hosts

29 Routing table (contd) Flags (contd) Flags (contd) –G present  Addresses aggregated in “Destination” column indirectly connected –“G” suggests “gateway” –G absent  Addresses aggregated in “Destination” column directly connected

30 Routing Table Destination address type: H flag or no H flag N/wHost Connection type: G flag or no G flag Direct Indirect

31 144.16.68.2 /19 144.16.68.x / 19 144.16.66.x / 19 144.16.72.x / 19144.16.79.x / 19 Router 144.16.64.1/19 X What will the routing table of X look like?

32 Routing Table 144.16.68.2 / 19 = 144.16.64.0 144.16.68.2 / 19 = 144.16.64.0 144.16.66.x / 19 = 144.16.64.0 144.16.66.x / 19 = 144.16.64.0 144.16.72.x / 19 = 144.16.64.0 144.16.72.x / 19 = 144.16.64.0 All addresses share a common 19 bit prefix: All addresses share a common 19 bit prefix: –144.16.64.0 A single entry should be used to communicate with all hosts on the LAN A single entry should be used to communicate with all hosts on the LAN


Download ppt "Ethernet switch Hosts Can talk using Ethernet addresses only."

Similar presentations


Ads by Google