Appearance
Lab 1: Single Subnet Experiment β
Learning Objectives β
- Basic GNS3 Usage
- Understand L2 Forwarding (MAC address forwarding)
- Observe ARP operation process
- Learn IP address configuration
- Use Capture function to observe packets
Topology Diagram β

Background Knowledge β
Network Protocol Layer Model β
Network communication uses a layered model to organize protocols. Below is a comparison of the OSI model and TCP/IP model:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β OSI 7-Layer Model vs TCP/IP Model β
βββββββββββββ¬βββββββββββββββββββββββ¬βββββββββββββββ¬ββββββββββββββββββββ€
β OSI Layer β Layer Name β TCP/IP β Protocol/Tech β
βββββββββββββΌβββββββββββββββββββββββΌβββββββββββββββΌββββββββββββββββββββ€
β L7 β Application Layer β β HTTP, FTP, DNS β
β L6 β Presentation Layer β Application β SMTP, Telnet β
β L5 β Session Layer β Layer β SSH, TLS/SSL β
βββββββββββββΌβββββββββββββββββββββββΌβββββββββββββββΌββββββββββββββββββββ€
β L4 β Transport Layer β Transport β TCP, UDP β
βββββββββββββΌβββββββββββββββββββββββΌβββββββββββββββΌββββββββββββββββββββ€
β L3 β Network Layer β Internet β IP, ICMP, IGMP β
βββββββββββββΌβββββββββββββββββββββββΌβββββββββββββββΌββββββββββββββββββββ€
β L2 β Data Link Layer β Network β Ethernet, ARP β
β L1 β Physical Layer β Access β Cable, Hub, NIC β
βββββββββββββ΄βββββββββββββββββββββββ΄βββββββββββββββ΄ββββββββββββββββββββ| Layer | Main Function | Covered in This Lab |
|---|---|---|
| L7-L5 (Application) | Provide network services for applications | β |
| L4 (Transport) | End-to-end reliable transmission, flow control | β |
| L3 (Network) | IP addressing, routing | β (IP, ICMP) |
| L2 (Data Link) | MAC addressing, frame forwarding | β (Switch, ARP) |
| L1 (Physical) | Bit stream transmission | β (Cable) |
Ethernet frame β
Ethernet frame is the Layer 2 packet format. Its structure is as follows:
ββββββββββββ¬ββββββββββ¬ββββββββββ¬ββββββββββββ¬ββββββββββββββ¬ββββββ
β Preamble β Dest MACβ Src MAC β EtherType β Payload β FCS β
β 8 bytes β 6 bytes β 6 bytes β 2 bytes β 46-1500 B β 4 B β
ββββββββββββ΄ββββββββββ΄ββββββββββ΄ββββββββββββ΄ββββββββββββββ΄ββββββ| Field | Description |
|---|---|
| Preamble | Used for synchronization (7 bytes) + SFD (1 byte) |
| Dest MAC | Destination MAC address |
| Src MAC | Source MAC address |
| EtherType | Indicates upper layer protocol (e.g., 0x0800 = IPv4, 0x0806 = ARP) |
| Payload | Actual data content |
| FCS | Frame Check Sequence, used for error detection (CRC-32) |
MAC Address Format
MAC address is a 48-bit hardware address, typically represented as 6 groups of hexadecimal digits: AA:BB:CC:DD:EE:FF
L2 Forwarding (Layer 2 Forwarding) β
How does a Switch forward packets?
- Learn: When receiving a packet, record the source MAC and incoming port
- Lookup: Check if destination MAC is in the MAC Table
- Forward:
- Known β Send out from corresponding port
- Unknown β Broadcast to all ports (Flooding)
ARP (Address Resolution Protocol) β
When PC1 wants to communicate with PC2, it needs to know PC2's MAC address:
PC1: "Who has 10.0.0.2? Tell 10.0.0.1" (ARP Request - Broadcast)
PC2: "I am 10.0.0.2, my MAC is XX:XX:XX" (ARP Reply - Unicast)Steps β
Step 1: Build Topology β
- Open GNS3
- Drag in 1 Ethernet switch

- Drag in 3 VPCS (as end hosts)

- Connect links:
- PC1 β Switch (eth0)
- PC2 β Switch (eth1)
- PC3 β Switch (eth2)
- Start all devices

Step 2: Configure VPCS β
Set IP on each of the three VPCS:
PC1:
ip 10.0.0.1/24PC2:
ip 10.0.0.2/24PC3:
ip 10.0.0.3/24Step 3: Test Connectivity β
Execute on PC1:
bash
# ping PC2
ping 10.0.0.2
# ping PC3
ping 10.0.0.3
# View ARP table
arpPacket Capture Experiment β
Observe ARP Process β
- Right-click on the link between PC1 and Switch β Start capture
- Wireshark will open automatically
- Clear ARP cache on PC1:
clear arp - Execute
ping 10.0.0.2 - Observe packets in Wireshark:
Frame 1: ARP Request
Who has 10.0.0.2? Tell 10.0.0.1
Frame 2: ARP Reply
10.0.0.2 is at xx:xx:xx:xx:xx:xx
Frame 3: ICMP Echo Request
10.0.0.1 β 10.0.0.2
Frame 4: ICMP Echo Reply
10.0.0.2 β 10.0.0.1Extend: Replace Switch with a Linux Docker Appliaces β
Step 1: Replace Switch with a Linux Docker Appliaces β
Step 2: Configure Linux Switch β
Double-click the Linux node to open Console:
bash
# Create Bridge (software switch)
ip link add br0 type bridge
ip link set br0 up
# Add physical interfaces to Bridge
ip link set eth0 master br0
ip link set eth1 master br0
ip link set eth2 master br0
# Enable all interfaces
ip link set eth0 up
ip link set eth1 up
ip link set eth2 up
# Verify configuration
bridge link showWhat is Bridge?
Linux Bridge is a kernel built-in software switch that can bridge multiple network interfaces together, just like a physical switch.
Observe MAC Table β
On the Linux Switch:
bash
# View Bridge MAC learning table
bridge fdb show br br0Discussion Questions β
Q1: Why is the first ping slower?
Because the first time requires ARP resolution first, waiting for ARP Reply before ICMP can be sent.
Q2: What happens if PC2's network cable is disconnected?
- ping will fail (timeout)
- ARP Request will continue broadcasting but won't receive Reply
- After some time, ARP cache will expire
Q3: Does the Switch itself need an IP?
Not needed for pure L2 forwarding. Switch only looks at MAC addresses, not IP. However, if you want to remotely manage the Switch, you need to configure a management IP.
Next Step β
After completion, proceed to Lab 2: VLAN Experiment