710 likes | 722 Views
Lektion 9 Lektion 9. Repetition: Adresseringstekniker. Kapitel 19: Internetworking, addressing and Routing. Kapitel 20: Network Layer Protocols: ARP, IPv4, ICMP, IPv6 and ICMPv6. Repetition: Fysisk adress och nätverksadress. I figur 2.11 vill vi sända data från
E N D
Lektion 9 Lektion 9 Repetition: Adresseringstekniker Kapitel 19: Internetworking, addressing and Routing. Kapitel 20: Network Layer Protocols: ARP, IPv4, ICMP, IPv6 and ICMPv6.
Repetition: Fysisk adress och nätverksadress I figur 2.11 vill vi sända data från en nod med logisk nätverksadress (IP-adress) A och fysisk adress 10 till en nod med IP-adress P och fysisk adress 95. De två enheterna befinner sig i olika LAN. Därför kan vi inte enbart använda deras fysiska adress. Den fysiska adressen kan enbart användas vid kommunikation inom ett LAN. De två routrarna förstår av IP- adressen vilken väg paketen ska vidareförmedlas, och ändrar paketets fysiska adressering.
Adresser till min dator Adresser till min dator Fysisk MAC-adress, 48 bitar: 00-00-E2-4F-54-04 IP-adress, 32 bitar: 193.10.250.187. Intern NAT-IP-adress (Network Address Translation): 10.14.1.63. IP-subnetmask: 255.255.0.0 DNS-namn (Domain namn Service): mageripc.itm.miun.se, där itm.miun.se är DNS-suffix, och .se är toppdomän. URL till webbsida på webbserver på min dator: http://mageripc.itm.miun.se:portnummer/filkatalog/filnamn.typ Portnumret är default 80. Många datorer i världen har DNS-alias ”www”. URL till ftp-fil på min dator: ftp://användanamn:lösenord@mageripc.itm.miun.se/filkatalog/filnamn.typ Filnamn till fil vid delad diskaccess till min dator: \\mageripc.itm.miun.se\filkatalog\filnamn.typ (Av säkerhetsskäl inte tillgänglig utanför nätet.) E-postadress till användare på en e-postserver på min dator: användarnamn@mageripc.itm.miun.se • • • • • • • • •
System och protokoll för System och protokoll för översättning mellan olika översättning mellan olika adresseringstekniker adresseringstekniker • ARP (Address resolution protocol) översätter IP-adress till fysisk adress. • DHCP (Dynamic Host Configuration Protocol) kan ge varje dator en ledig IP-adress, och talar om för en dator med en viss fysisk adress vilken dess IP-adress är vid varje omstart. • DNS (Domain Name Server) är ett system av databaser som översätter mellan IP-adress och DNS-adress. • NAT (Network Address Translation) är en server, ofta i anslutning till företagets brandvägg, som modifierar IP-paketen genom att byta ut intern avsändar-IP-adress och portnummer till extern IP-adress + portnummer vid utgående paket, och vice versa vid inkommande. På så sätt kan många dela på samma externa IP-adress.
PART IV PART IV Network Layer
Chapter 19 Host-to-Host Delivery: Internetworking, Addressing, and Routing
Figure 19.1 Internetwork
Figure 19.3 Network layer in an internetwork
Figure 19.7 Switching
Figure 19.8 Datagram approach
Note: Switching at the network layer in the Internet is done using the datagram approach to packet switching.
Note: Communication at the network layer in the Internet is connectionless.
Figure 19.9 Dotted-decimal notation
IP IP- -adresser adresser • 32-bit adress i dagens IP version 4. 64-bit i IPversion 6. • Exempelvis har Utbildningsradions www-server IP- adressen 1100 0001 0000 1100 0101 1011 0001 1111 binärt. • På punkterad decimalform blir det 193.12.91.31. • Hexadecimalt blir det C10C5B1F. 1100 0001 0000 1100 0101 1011 0001 1111 F C 1 0 C 5 D 1 . . . 31 193 12 91
Note: The binary, decimal, and hexadecimal number systems are reviewed in Appendix B.
Example 1 Change the following IP addresses from binary notation to dotted- decimal notation. a. 10000001 00001011 00001011 11101111 b. 11111001 10011011 11111011 00001111 Solution We replace each group of 8 bits with its equivalent decimal number (see Appendix B) and add dots for separation: a. 129.11.11.239 b. 249.155.251.15
Example 2 Change the following IP addresses from dotted-decimal notation to binary notation. a. 111.56.45.78 b. 75.45.34.78 Solution We replace each decimal number with its binary equivalent (see Appendix B): a. b. 01101111 00111000 00101101 01001110 01001011 00101101 00100010 01001110
Hierarchical Addressing Hierarchical Addressing • Network address – A part used by the router • Host address – Specific part or device on the network network node 3.1 1 1 2 3 1 A 1.1 1.2 1.3 2.1 An example of hierarchical addressing 2 Each node is actually an interface to the network 3 1
Note: In classful addressing, the address space is divided into five classes: A, B, C, D, and E.
Figure 19.10 Finding the class in binary notation
Figure 19.11 Finding the address class
Example 3 Find the class of each address: 00000001 00001011 00001011 11101111 a. 11110011 10011011 11111011 00001111 b. Solution See the procedure in Figure 19.11. a. b. The first bit is 0; this is a class A address. The first 4 bits are 1s; this is a class E address.
Figure 19.12 Finding the class in decimal notation
Example 4 Find the class of each address: 227.12.14.87 a. 252.5.15.111 b. 134.11.78.56 c. Solution a. b. c. The first byte is 227 (between 224 and 239); the class is D. The first byte is 252 (between 240 and 255); the class is E. The first byte is 134 (between 128 and 191); the class is B.
Figure 19.13 Netid and hostid
Figure 19.14 Blocks in class A
Figure 19.15 Blocks in class B
Figure 19.16 Blocks in class C
Note: A network address is different from a netid. A network address has both netid and hostid, with 0s for the hostid.
Figure 19.17 Network address
Example 5 Given the address 23.56.7.91, find the network address. Solution The class is A. Only the first byte defines the netid. We can find the network address by replacing the hostid bytes (56.7.91) with 0s. Therefore, the network address is 23.0.0.0.
Example 6 Given the address 132.6.17.85, find the network address. Solution The class is B. The first 2 bytes defines the netid. We can find the network address by replacing the hostid bytes (17.85) with 0s. Therefore, the network address is 132.6.0.0.
Example 7 Given the network address 17.0.0.0, find the class. Solution The class is A because the netid is only 1 byte.
Klasslösa adresser Klasslösa adresser • Idag används subnetting och klasslösa adresser med hjälp av IP-masker. En 1:a i IP-masken betyder att motsvarande bit i adressen tillhör Net-ID. • Exempel: IP-masken 255.255.0.0 = FFFF0000 (sexton 1:or och sexton 0:or) betyder att de första 16 bitarna i IP- adressen är Net-ID, övriga är Host-ID.
Figure 19.21 Addresses in a network with and without subnetting
Table 19.1 Default masks Using Slash notation Class In Binary In Dotted-Decimal A 11111111 00000000 00000000 00000000 255.0.0.0 /8 B 11111111 11111111 00000000 00000000 255.255.0.0 /16 C 11111111 111111111 11111111 00000000 255.255.255.0 /24
Note: The network address can be found by applying the default mask to any address in the block (including itself). It retains the netid of the block and sets the hostid to 0s.
Example 8 A router outside the organization receives a packet with destination address 190.240.7.91. Show how it finds the network address to route the packet. Solution The router follows three steps: 1. The router looks at the first byte of the address to find the class. It is class B. 2. The default mask for class B is 255.255.0.0. The router ANDs this mask with the address to get 190.240.0.0. 3. The router looks in its routing table to find out how to route the packet to this destination. Later, we will see what happens if this destination does not exist.
Figure 19.23 Subnet mask
Example 9 A router inside the organization receives the same packet with destination address 190.240.33.91. Show how it finds the subnetwork address to route the packet. Solution The router follows three steps: 1. The router must know the mask. We assume it is /19, as shown in Figure 19.23. 2. The router applies the mask to the address, 190.240.33.91. The subnet address is 190.240.32.0. 3. The router looks in its routing table to find how to route the packet to this destination. Later, we will see what happens if this destination does not exist.
Broadcast IP address Broadcast IP address • Broadcast IP address is used when information needs to be sent to all the hosts on the same network ○ Convenient in broadcast networks (such as Ethernet) • Broadcast IP address is obtained when host bits are replaced by 1s.
Example: Example: Network addresses 192.16.4.0 192.16.4.3 172.16.4.255 192.16.4.255 192.16.4.1 192.16.4.2 192.16.5.0 192.16.5.3 192.16.5.1 192.16.5.2 172.16.5.255 192.16.5.255 192.16.3.0 192.16.3.4192.16.3.5 172.16.3.255 192.16.3.255 192.16.3.3 192.16.3.1 192.16.3.2 Host addresses Broadcast addresses The mask is 255.255.255.0 for all hosts
Unicast, Multicast and Reserved Unicast, Multicast and Reserved Addresses Addresses Unicast address is used for one-to-one communication Multicast address is used for one-to-many communication (group communication) – D class Reserved addresses – Besides the addresses in class E reserved addresses are: ○ Network addresses – all host bits are 0 ○ Broadcast addresses – all host bits are 1 ○ All network part 0 – host on this network ○ 127.0.0.0 mask 255.0.0.0 and all host addresses on this network are reserved for testing purposes. 127.0.0.1 = localhost. ○ 0.0.0.0 – default route • • •
Address Resolution Protocol Address Resolution Protocol (ARP) (ARP) • ARP is necessary whenever a device need to send an IP packet to another device on the same LAN ○ The two devices can be two hosts, or host and router, or two routers that are on the same network • ARP resolves the IP address into a physical address (MAC addresses).
Figure 20.2 ARP operation
Figure 20.5 Four cases using ARP
Note: An ARP request is broadcast; an ARP reply is unicast.