2018/07/24
Internet Protocol
Internet Protocol (IP) is a protocol in Internet layer of Internet Protocol Suite. Responsible for delivery packets between hosts. Provide an unreliable transmission service. All devices in the Internet have an IP address.
Internet Protocol (IP) is a protocol in Internet layer of Internet Protocol Suite. Responsible for delivery packets between hosts. Provide an unreliable transmission service. All devices in the Internet have an IP address.
IP Address (Internet Protocol Address)
Each device connected to the Internet should have an IP address. The IP address is dynamic. Usually, each time you reconnect to the Internet, you will get a different IP address.
Note: Each interface has an IP address. For example, a three interfaces router will has three IP addresses.
Each device connected to the Internet should have an IP address. The IP address is dynamic. Usually, each time you reconnect to the Internet, you will get a different IP address.
- IPv4 format
- Decimal (Human friendly): 0.0.0.0 ~ 255.255.255.255
- Binary: 00000000.00000000.00000000.00000000 ~ 11111111.11111111.11111111.11111111
Note: Each interface has an IP address. For example, a three interfaces router will has three IP addresses.
Classful Addressing
Divides IP address into 5 address classes
Divides IP address into 5 address classes
According from the table, we know that
- There are 128 class A (00000000 ~ 011111111)
- Each class A has 16,777,216 address. For example:
The address in class A 00001111 can be
00001111.00000000.00000000.00000000 ~ 00001111.11111111.11111111.11111111
- Each class A has 16,777,216 address. For example:
- There are 16,384 class B (10000000.00000000 ~ 10111111.11111111)
- Each class B has 65,536 address. For example:
The address in class B 10001111.00001111 can be
10001111.00001111.00000000.00000000 ~ 10001111.00001111.11111111.11111111
- Each class B has 65,536 address. For example:
- There are 2,097,152 class C (11000000.00000000.00000000 ~ 11011111.11111111.11111111)
- Each class C has 256 address. For example:
The address in class C 11001111.00001111.00001111 can be
11001111.00001111.00001111.00000000 ~ 11001111.00001111.00001111.1111111
- Each class C has 256 address. For example:
- Class D and class E are reserved and many older routers do not accept it.
What are the disadvantages of classful addressing?
If a 200-person company becomes a 300-person company. The company will upgrade the class address level from C to B. It will have the number of 256 addresses changed to 65535. However, the company now uses only 300 addresses, and the other 65235 addresses will be idle.
If a 200-person company becomes a 300-person company. The company will upgrade the class address level from C to B. It will have the number of 256 addresses changed to 65535. However, the company now uses only 300 addresses, and the other 65235 addresses will be idle.
Classless Inter-Domain Routing (CIDR)
- Define IP address into two parts a.b.c.d/x
- a.b.c.d is original IP address
- /x is presents the host address length (subnet mask)
For example,
200.15.24.0/21
11001000.00001111.00011000.00000000
- How to assignment of CIDR blocks?
Suppose we divide the block into 8 sub-blocks.
Internet Protocol version 4 (IPv4) Datagram Format
- Version column can be IPv4 or IPv6
- Type of service (ToS) column defined that datagram's priority, low-delay, high-throughput or hight-reliable.
- Id, flag and fragmentation offset column are used for transmitting.
- Time-to-live column is present that how long can this datagram survive in the Internet.
- Transport Protocol column can be 6 (TCP), 17 (UDP) or other values.
- Data column is the data from upper layer (Transport Layer).
For example,
How does IP datagrams are transmitted by slicing datagrams into fragments?
- Maximum Transmission Unit (MTU)
- The MTU of a standard Ethernet datagram is 1518 octets (bytes). 14 octets of header, 4 octets of frame check sequence (FCS) and 1500 octets of data.
- The MTU of an IP fragment is 1500 octets. 20 octets of header and 1480 of data.
- Same datagram slice into fragments have same identification number (ID).
- The offset shows the starting position of this fragment in the datagram.
- The flag indicates whether this fragment is the end of the datagram.
- Fragment 1
- Send 1480 octets.
- Offset is 0.
- Flag is 1.
- Fragment 2
- Send 1480 octets.
- Offset is 185 (1480 / 8 bits = 185)
- Flag is 1.
- Fragment 3
- Send 512 octets.
- Offset is 370 (1480 * 2 / 8 bits = 370)
- Flag is 0 (The end of the datagram)
Copyright © 2018 William Hsu All rights reserved.