Professional Documents
Culture Documents
NETWORK LAYER
HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY Smart Applications & Network System Laboratory
Add : Room 618, Ta Quang Buu Library
No.1 Dai Co Viet Road, Hanoi, Vietnam
TRAN QUANG VINH Mobile : (+84) 912 636 939
Email : vinh.tranquang1@hust.edu.vn
Ph.D., Assoc. Prof., Senior Lecturer m706501@shibaura-it.ac.jp
School of Electrical and Electronic Engineering Website : https://sanslab.vn
Contents
Router architecture and functions
IP Addressing
Internet Protocol
Routing Protocol
IP protocol
Path-selection • datagram format
algorithms: • addressing
network implemented in • packet handling conventions
forwarding
layer • routing protocols
(OSPF, BGP) table ICMP protocol
• SDN controller • error reporting
• router “signaling”
link layer
physical layer
application
transport
network
enterprise link
network physical
0111 1
2
3
Routing
Algorithm
control
plane
data
plane
values in arriving
packet header
0111 1
2
3
Remote Controller
control
plane
data
plane
CA
CA CA CA CA
values in arriving
packet header
0111 1
2
3
routing, management
routing control plane (software)
processor operates in millisecond
time frame
forwarding data plane
(hardware) operates
in nanosecond
timeframe
high-speed
switching
fabric
lookup,
link forwarding
line layer switch
protocol fabric
termination
(receive)
queueing
physical layer:
Nhận dữ liệu ở dạng bit
Chuyển mạch phi tập trung:
link layer:
sử dụng các giá trị trường tiêu đề, tra cứu cổng
e.g., Ethernet
đầu ra bằng bảng chuyển tiếp
Chuyển tiếp dự trên địa chỉ IP đích
Chuyển tiếp tổng quát dựa trên giá trị trường tiêu đề
Đệm cổng đầu vào: nếu datagram đến nhanh hơn
tốc độ chuyển tiếp vào cơ cấu chuyển mạch
otherwise 3
Ví dụ
11001000 00010111 00010110 10100001 which interface?
11001000 00010111 00011000 10101010 which interface?
R (rate: NR, R
ideally)
...
...
R R
input output
port memory port
(e.g., (e.g.,
Ethernet) Ethernet)
system bus
switch switch
fabric fabric
Tranh chấp cổng đầu ra: chỉ có thể truyền gói màu xanh lá cây bị chặn HOL
một datagram màu đỏ. gói màu đỏ phía
dưới bị chặn
datagram
switch buffer link
fabric layer line R
protocol termination
queueing (send)
scheduling
Abstraction: queue
R packet
departures
packet
arrivals queue link
(waiting area) (server)
w1
R w2 R
8 bit (0 - 255)
Class A 0 7bit H H H
Class B 1 0 6bit N H H
Class C 1 1 0 5bit N N H
Class D 1 1 1 0 Multicast
Class E 1 1 1 1 Reserve for future use
# of network # of hosts
Class A 2^7=128 2^24
Class B 2^14=16384 2^16=65536
Class C 2^21 2^8=256
Loopback Address
/
Loopback address 127.0.0.1 / 127.1.*
Multicast address
224.0.0.0~239.255.255.255
(RFC5771)
DHCP
223.1.1.0/24
server
223.1.1.1 223.1.2.1
223.1.2.0/24
223.1.3.1 223.1.3.2
223.1.3.0/24
DHCP offer
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
transaction ID: 654
lifetime: 3600 secs
DHCP request
src: 0.0.0.0, 68
dest:: 255.255.255.255, 67
yiaddrr: 223.1.2.4
transaction ID: 655
lifetime: 3600 secs
DHCP ACK
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
transaction ID: 655
lifetime: 3600 secs
request reply
Message type: Boot Request (1)
Hardware type: Ethernet
Hardware address length: 6
Hops: 0 Message type: Boot Reply (2)
Transaction ID: 0x6b3a11b7 Hardware type: Ethernet
Seconds elapsed: 0 Hardware address length: 6
Bootp flags: 0x0000 (Unicast) Hops: 0
Client IP address: 0.0.0.0 (0.0.0.0) Transaction ID: 0x6b3a11b7
Your (client) IP address: 0.0.0.0 (0.0.0.0) Seconds elapsed: 0
Next server IP address: 0.0.0.0 (0.0.0.0) Bootp flags: 0x0000 (Unicast)
Relay agent IP address: 0.0.0.0 (0.0.0.0) Client IP address: 192.168.1.101 (192.168.1.101)
Client MAC address: Wistron_23:68:8a (00:16:d3:23:68:8a) Your (client) IP address: 0.0.0.0 (0.0.0.0)
Server host name not given Next server IP address: 192.168.1.1 (192.168.1.1)
Boot file name not given Relay agent IP address: 0.0.0.0 (0.0.0.0)
Magic cookie: (OK) Client MAC address: Wistron_23:68:8a (00:16:d3:23:68:8a)
Option: (t=53,l=1) DHCP Message Type = DHCP Request Server host name not given
Option: (61) Client identifier Boot file name not given
Length: 7; Value: 010016D323688A; Magic cookie: (OK)
Hardware type: Ethernet Option: (t=53,l=1) DHCP Message Type = DHCP ACK
Client MAC address: Wistron_23:68:8a (00:16:d3:23:68:8a) Option: (t=54,l=4) Server Identifier = 192.168.1.1
Option: (t=50,l=4) Requested IP Address = 192.168.1.101 Option: (t=1,l=4) Subnet Mask = 255.255.255.0
Option: (t=12,l=5) Host Name = "nomad" Option: (t=3,l=4) Router = 192.168.1.1
Option: (55) Parameter Request List Option: (6) Domain Name Server
Length: 11; Value: 010F03062C2E2F1F21F92B Length: 12; Value: 445747E2445749F244574092;
1 = Subnet Mask; 15 = Domain Name IP Address: 68.87.71.226;
3 = Router; 6 = Domain Name Server IP Address: 68.87.73.242;
44 = NetBIOS over TCP/IP Name Server IP Address: 68.87.64.146
…… Option: (t=15,l=20) Domain Name = "hsd1.ma.comcast.net."
Four separate Class C networks may be combined to create one large supernetwork
Computer Network @ 2022 TRAN-QUANG VINH ◦ HUST 40
Classless Inter-Domain Routing (CIDR)
Example 1:
• Một ISP được cấp một địa chỉ mạng: 192.10.64.0/19
• Tìm mặt nạ mạng, địa chỉ đầu tiên và địa chỉ cuối cùng trong giải địa chỉ,
địa chỉ broadcast và số lượng host cho mạng trên.
Solution
• Network address:
11000000 00001010 010|00000 00000000 = 192.10.64.0/19
• Net mask:
11111111 11111111 111|00000 00000000 = 255.255.224.0
• The network address: 010|00000 00000000 = 192.10.64.0/19
• The first host address: 010|00000 00000001 = 192.10.64.1
• Broadcast address: 010|11111 11111111 = 192.10.95.255
• The last host address: 010|11111 11111110 = 192.10.95.254
• There are 213 host addresses (32 - 19 = 13) in this range. So the ISP can
allocate 8192 - 2 = 8190 host addresses