Network Layer_Internet Protocol_Basics and Routing
Outline
- Fundamentals
- Host
- Addressing
- Router
- Routing
Fundamentals
- The IP Protocol is just one example of Network Protocol
- Each layer should be independent.
- Modular by Design
- Simplifies Architecture and Implementation
Layers
Accept/Deliver data to/from
- Upper Layers
- Data Link
OSI与Internet
L2 address=Ethernet地址
层与层之间是独立的;传输层应屏蔽下层的数量、类型和拓扑;即使跨 LAN 和 WAN,传输层可用的网络地址也应使用统一的编号计划。
Host
(from IP perspective)
- Device with one (or more) L3 endpoint // IP Address
Network Topology & Data Flow
IPv4 Header
Addressing
IP地址由两部分组成:Network Address(Network id)+Host ID(Host id)
- ipv4: 32 bits
- 例 140.252.1.29
- ipv6: 128 bits
- 例 2001:0db8:85a3:0000:0000:8a2e:0370:7334
Subnet mask
Address + subnet mask => host & net ID
- A & MASK => NetID
- A &!MASK => HostID
Two notations (examples)
- “Classbased” 255.255.255.0
- “Classless” /24
Subnet Example (3个)
这里放其中一个为例
Subnet, Forwarding and Gateway
Forwarding Table (转发表),例
转发表的例子见PPT。
Address Resolution Protocol (ARP) [Ethernet]
- Translate between Network and L2 address
ARP表,例
ARP表如果没有match的,则会广播寻找,随后再增加到ARP表中。
ARP的运行见PPT。
Router
- Device with two (or more) L3 endpoints // IP Address within TWO different subnets
对比Host - Device with one (or more) L3 endpoint // IP Address
路由表,例
路由转发的例子见PPT。