6 ccna (fundamentals of i pv4 addressing and routing)
Classful ip address (ip address picture book 4 from visual land animations)
1.
2.
3. Overview: Classful IP, routing table Animation Link 05/16/11 www.visualland.net Goal: Use examples to show how classful IP addresses are being used by routers to forward packets. Topology: 3 computerrs are assigned class A, B, C addresses. They are connecred to a router R1. Steps: 1) Jack ping Rose. R1 lookup network address and forwards ping to Rose 2) Rose responds by sending an Echo back to Jack. R1 forwards it to Jack. 3) Jack ping Tom in the same network as Mary. Tom is offline. Mary recevies ping and drops it.
4.
5.
6.
7.
8. Jack Ping Rose 05/16/11 www.visualland.net Jack ping Rose. Ping's destiination IP address is Rose's IP address 150.1.2.3/16. This is a class B address (150 is between 128~191). It's mask is /16. It means that a 32 bit IP address is divided into two parts, the left 16 bits is network ID (150.1), the network ip address is 150.1.0.0; The right 16 bits is host ID (2.3). Note: See more IP address classification details in FAQ.
9. R1 forwards ping to Mary 05/16/11 www.visualland.net When R1 receives ping, it reads destination IP address (150.1.2.3/16), extracts network address (150.1.0.0/16) and uses network address to lookupop its routing table. A match is found: (150.1.0.0/16, Port2). R1 forwards ping to Port2 and delivers poing to next hop. Note: See more details in FAQ for the relastionships between IP address, class, mask, network address, routing table entry.
10. Rose sends Echo to Jack 05/16/11 www.visualland.net When Rose receives Ping. It responds an Echo back to Jack. Echo's destination address is Jack's IP addtress 100.4.5.6. It's the sender's address of Ping. This is a class A address (100 is between 0~127). Network mask is /8: The leftmost 8 bit is used for network ID, the rightmost 24 bit is used for host ID.
11. R1 forwards Echo to Jack 05/16/11 www.visualland.net When R1 receives Echo, it extracts netwrok address (100.0.0.0/8) from Echo's destination address (100.4.5.6/.8) and uses network address to lookup its routing table. A mtch is found: (100.0.0.0/8, Port1). R1 forwards Echo to Port1. Ping is delviered to next hop (Jack).
12. Jack ping Tom 05/16/11 www.visualland.net Jack ping Tom. Tom's IP is 222.111.44.50/24, a class C address (222 is between 192~223). When R1 receives ping, it uses Ping's destination network address 222.111.44.0/24 to lookup its routing table. A match is found: (222.111.44.0/24, Port3). R1 forwards Ping to Port3 and deliviers it to network 222.111.44.0/8. Note: Router's job is to forwards packets to next hop. It does not know whether the target host exist or not. Note: Tom and Mary (222.111.44.33/24) have the same network address 222.111.44.0/8
13. Jack ping Tom 05/16/11 www.visualland.net Jack ping Tom. Tom's IP is 222.111.44.50/24, a class C address (222 is between 192~223). When R1 receives ping, it uses Ping's destination network address 222.111.44.0/24 to lookup its routing table. A match is found: (222.111.44.0/24, Port3). R1 forwards Ping to Port3 and deliviers it to network 222.111.44.0/8. Note: Router's job is to forwards packets to next hop. It does not know whether the target host exist or not. Note: Tom and Mary (222.111.44.33/24) have the same network address 222.111.44.0/8
14. Tom is offline 05/16/11 www.visualland.net Ping is forwarded to 222.111.44.0/24 network. This is an Ethernet Local Area network. All nodes will receive this ping. In this network, Ping reaches Mary and Tom. Mary receives this ping and drops it due to mis-match. Tom is offline and drops the ping.
15.
16.
Notas do Editor
Q1. What is IP address classes? A 32-bit IP address is divided into network ID and host ID. It is classified into 5 classes: A, B, C, D, E. The division is based on network mask, a fixed length of leftmost bits assigned to network ID. Q2. How to classify IP address? IP address has 32 bits (4 bytes) and is often represented as 4 decimal numbers a.b.c.d, one number per byte. Each number's value is between 0~255. They are classified as follows: Class A: "a" is 0~127. Network ID is "a" (the leftmost digit). Host ID is "b.c.d " (right 3 digits) Class B: "a" is 128~191. Network ID is "a.b" (the left 2 digits). Host ID is "c.d " (the right 2 digits) Class C: "a" is 192~223. Network ID is "a.b.c" (the leftmost 3 digits). Host ID is "d " (the rightmost digit) Class D, E: "a" is 224~255. Class D addresses are used for multicasting. Class E addresses are reserved for scientific research. Q3. How many host IDs and network IDs for class A, B, C addresses? The number of host/network IDs is determined by the number of bytes allocated for each class. Class Host-IDs Network-IDs Usage A 16,777,216 256 Very large networks B 65,536 65,536 Large networks C 256 16,777,216 Small networks. Each contains no more than 256 computers. Note: In each class, two host IDs are reserved and cannot be assigned to hosts: all 0 bits, all 1 bits. Q4. How to determine classes when IP addresses are presented in binary? We can just look at the first byte (leftmost 3 bits) Number of left- Leftmost byte a.b.c.d Class most bits, value in binary (4-decimals) A 1 bit: 0 0xxxxxxx a is 0~127 B 2 bit: 10 10xxxxxx a is 128~191 C 3 bit: 110 110xxxxx a is 192~223 Note: The relationship between classful address and routing table destination network is more clear when playing the companion simulation. Q5. How well does classful address work? It worked well in the early stage of Internet when there were not too many computers connected to Internet. However, classifying IP addresses by fixed length of bit does not scale well when the number of networks increases. For example, how to assign a network address for a group of 1000 computers? One class C network is not enough. If allocate a class B address space for this group, there are 64,536 host IDs unused. It's a big waste. To solve this problem, computer scientists designed classless IP address (or subnetting) to further divide a classful address space into smaller networks. This way, a group of 1000 computers can fit into a network address that contains 1024 hosts. To learn classless IP address, see next simulation: IP subnetting.