Forwarding - jibingl/CCNA-CCNP GitHub Wiki
Layers | Match Rules | What's done at the layer? |
---|---|---|
Layer 2 | Exact match | Forwarding |
On the local switch, MAC-address table is enumerated to look for the source MAC address.
Yes, reset time stamp; send to dest's port
/
Source MAC ------ Check MAC-Address Table ------ Has the source MAC?
\
No, add an record; flood out
Layers | Match Rules | What's done at the layer? |
---|---|---|
Layer 3 | Most specific match | Decrement TTP; recompute IP header checksum; change MACs; recompute ethernet FCS; Forwarding |
On the source host, the Bitwise operation determines to where a network package should be forward.
..-------.
Source IP ----\\ \ .-------. Yes, send to destination
|| XOR . ------------| \ /
Destination IP ----// / | AND | --------- Result zero?
``-------` .-------| / \
| `-------` No, sned to default gateway
Source IP mask
Examples | Same subnet | Different subnet |
---|---|---|
----> | From 192.168.1.100/24 to 192.168.1.200/24
|
From 192.168.1.100/24 to 192.168.14.100/24
|
Sour IP | 11000000.10101000.00000001.01100100 | 11000000.10101000.00000001.01100100 |
Dest IP | 11000000.10101000.00000001.11001000 | 11000000.10101000.00001110.01100100 |
XOR | 00000000.00000000.00000000.10101100 | 00000000.00000000.00001111.00000000 |
Sour Mask | 11111111.11111111.11111111.00000000 | 11111111.11111111.11111111.00000000 |
AND | 00000000.00000000.00000000.00000000 | 00000000.00000000.00001111.00000000 |
Type | Arch of control&data planes | Control plane | Data plane |
---|---|---|---|
Software-based | Shared | CPU | CPU |
Hardware-based | Separate | CPU | ASIC |
Hybrid | Separate | CPU | NP (Network Processor) |
ASICs with TCAM memory is used as hardware in routers
.---------------------------------------------------. .---------------------------------------------------.
| .----------CONTROL PLANE------------. | | .----------CONTROL PLANE------------. |
| | .-------------. .-------------. | | | | .-------------. .-------------. | |
| | |Routing Table| | ARP Table | | | | | |Routing Table| | ARP Table | | |
| | '---^-^-------' '-------^-^---' | | | | '---^---------' '---------^---' | |
| '------^-^-----------------^-^------' | | '------^---------------------^------' |
| .------^-^----DATA PLANE---^-^------. | | .------^------DATA PLANE-----^------. |
| | | | | | | | | | | | | |
| | lookup---(ip_input)---lookup | | | | lookup---(ip_input)---lookup | |
|----. | / / \ \ | .----| |----. | / ........v......... \ | .----|
--->|G0/0|-->----' / \ '---->--|G0/1|---> --->|G0/0|-->----' : Fast-Switching : '---->--|G0/1|--->
--->| |-->-----' '----->--| |---> --->| |-->---------: Cache :-------->--| |--->
|----' | | '----| |----' | '''''''''''''''''' | '----|
| '-----------------------------------' | | '-----------------------------------' |
'---------------------------------------------------' '---------------------------------------------------'
.---------------------------------------------------.
| .----------CONTROL PLANE------------. |
| | .-------------. .-------------. | |
| | |Routing Table| | ARP Table | | |
| | '-----v-------' '--------v----' | |
| '--------v------------------v-------' |
| .--------v----DATA PLANE----v-------. |
| | .-----v------------------v----. | |
| | | v CEF v | | |
|----. | | ....v........ .........v... | | .----|
--->|G0/0|-->--| : FIB : : Adjacency : |-->--|G0/1|--->
--->| |-->--| : : : Table : |-->--| |--->
|----' | ' ''''''''''''' ''''''''''''' ' | '----|
| '-----------------------------------' |
'---------------------------------------------------'
- FIB: Contains L3 next-hop information
- Adjacency Table: Contains L2 next-hop information
Example Network Topolgy
Using show ip cef
to display FIB table information
show ip cef 10.10.23.0 detail
Using show adjacency detail
to display the Adjacency Table detailed information
AABBCC000200
AABBCC000100
0800
representsDES-MAC
SRC-MAC
type
, in our case, it isR2's E0/0 MAC
R1's E0/0 MAC
IPv4
.
Enable the router connected to the destination subnets to not drop but forward a broadcast package into the destination subnet.
R1(config-if)# ip directed-broadcast
Example: ping
a broadcast IP of a remote subnet