Faculty of Engineering
Electronics and Communication
Department
Comm. Networks lab
Spring 2024
Academic year : Fourth
2024-2025
Faculty of Engineering
Electronics and Communication
Department
Comm. Networks lab
Spring 2024
Name:
Section:
Grade:
Date:
TA:
2
Table of Content
Instructions: ………………………………………………………….. 4
Introduction: …………………..…………………………………….. 5
Experiment (1): Static Routing …………………………………….. 6
Experiment (2): Distance Vector Routing (RIP) ………………… 19
Experiment (3): Link State Routing (OSPF) …..………………… 25
Experiment (4): Advanced Distance Vector (EIGRP) …..……… 31
Experiment (5): VLANs ……………………………………………. 37
Experiment (6): VTP ….……………………………………………. 45
Experiment (7): DTP …….…………………………………………. 50
Experiment (8): STP ……….……………………………………….. 53
3
INSTRUCTIONS
- Attend on-time.
- Read the experiment before you come.
- Don’t eat or drink in the laboratory.
- Keep the laboratory clean.
- Be quiet and polite.
4
INRODUCTION
This course covers the following:
- Static Routing Protocol
- Distance Vector Routing Protocol
- Link State Routing Protocol
- Advanced Distance Vector Routing Protocol
- VLANs
- VTP (VLAN Trunking Protocol)
- DTP (Dynamic Trunking Protocol)
- STP (Spanning Tree Protocol)
5
Experiment 1
Static Routing
Objective
To understand and apply static routing.
Tools and equipments
• PC
• Packet Tracer
6
Procedures
1- Perform the following topology
The IP Addresses are:
LAN 1: 1.0.0.0/8
LAN2: 2.0.0.0/8
NET 1: 10.0.0.0/8
7
a- Assign IPs for the PCs
PC0:
Click on PC, and then select a desktop tap
Then click on IP Configuration
And set
IPV4 Address, Subnet mask, and default gateway as the below picture
For PC1:
8
IP: 1.0.0.3
Subnet mask: 255.0.0.0
Default Gateway: 1.0.0.1
For PC2:
IP: 2.0.0.2
Subnet mask: 255.0.0.0
Default Gateway: 2.0.0.1
For PC2:
IP: 2.0.0.3
Subnet mask: 255.0.0.0
Default Gateway: 2.0.0.1
9
b- Assign IPs for the Interfaces of the Routers:
Log on the Router0
@Router0
Router> enable
Router# Configure terminal
Router(config)# interface g0/0
Router(config-if)# no shutdown
Router(config-if)# ip address 1.0.0.1 255.0.0.0
Router(config-if)# exit
Router(config)# interface g0/1
Router(config-if)# no shutdown
Router(config-if)# ip address 10.0.0.1 255.0.0.0
Router(config-if)# exit
Log on the Router1
@Router1
Router> enable
Router# Configure terminal
Router(config)# interface g0/0
Router(config-if)# no shutdown
Router(config-if)# ip address 2.0.0.1 255.0.0.0
Router(config-if)# exit
Router(config)# interface g0/1
Router(config-if)# no shutdown
Router(config-if)# ip address 10.0.0.2 255.0.0.0
Router(config-if)# exit
c- Shows the routing table
@Router0
Router# show ip route
@Router1
Router# show ip route
d- Adding Static Route to both routers
10
@Router0
Router(confi)# ip route 2.0.0.0 255.0.0.0 g0/1 → exit interface
Or
Router(confi)# ip route 2.0.0.0 255.0.0.0 10.0.0.2 → IP of the next hop
@Router1
Router(confi)# ip route 1.0.0.0 255.0.0.0 g0/1 → exit interface
Or
Router(confi)# ip route 1.0.0.0 255.0.0.0 10.0.0.1 → IP of the next hop
e- Shows the routing table
@Router0
Router# show ip route
@Router1
Router# show ip route
11
The Physical Topology will be as is the following
1- Click on the Home city
2- Create a new building in the city
3- Create a new closet (Room).
12
4- We have created two rooms, one for Data center that contains the switch and the
router and the other room that contains the laptops.
5- Create a new rack in the data center.
13
6- Place a router and the switch in the rack.
7- In the other room, create a table to be used to place the laptops on it.
14
8- Place the laptops on the table.
15
9- Connect between the switch and the router by the straight through cable.
10 – connect the laptops to the switch by the crossover cable
16
11- The connections between two rooms
12- Perform the same previous steps for the second building
13- The final connections between two buildings
17
The information of each cable by just hovering the mouse on it.
Comment:
------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
18
Experiment 2
Distance Vector Routing Protocol (RIP)
Objective
To understand and apply Dynamic Routing Protocol (RIP, OSPF, EIGRP).
Tools and equipments
• PC
• Packet Tracer
19
Procedures
1- Perform the following topology
The IP Addresses are:
LAN 1: 1.0.0.0/8
LAN2: 2.0.0.0/8
NET 1: 10.0.0.0/8
20
a- Assign IPs for the PCs
PC0:
Click on PC, and then select a desktop tap
Then click on IP Configuration
And set
IPV4 Address, Subnet mask, and default gateway as the below picture
21
For PC1:
IP: 1.0.0.3
Subnet mask: 255.0.0.0
Default Gateway: 1.0.0.1
For PC2:
IP: 2.0.0.2
Subnet mask: 255.0.0.0
Default Gateway: 2.0.0.1
For PC2:
IP: 2.0.0.3
Subnet mask: 255.0.0.0
Default Gateway: 2.0.0.1
22
b- Assign IPs for the Interfaces of the Routers
Log on the Router0 as described in Lab 4
@Router0
Router> enable
Router# Configure terminal
Router(config)# interface g0/0
Router(config-if)# no shutdown
Router(config-if)# ip address 1.0.0.1 255.0.0.0
Router(config-if)# exit
Router(config)# interface g0/1
Router(config-if)# no shutdown
Router(config-if)# ip address 10.0.0.1 255.0.0.0
Router(config-if)# exit
Log on the Router1 as described in Lab 4
@Router1
Router> enable
Router# Configure terminal
Router(config)# interface g0/0
Router(config-if)# no shutdown
Router(config-if)# ip address 2.0.0.1 255.0.0.0
Router(config-if)# exit
Router(config)# interface g0/1
Router(config-if)# no shutdown
Router(config-if)# ip address 10.0.0.2 255.0.0.0
Router(config-if)# exit
c- Shows the routing table
@Router0
Router# show ip route
@Router1
Router# show ip route
d- Adding RIP routing protocol
23
@Router0
Router(config)# router rip
Router(config-router)# network 1.0.0.0
Router(config-router)# network 10.0.0.0
@Router1
Router(config)# router rip
Router(config-router)# network 2.0.0.0
Router(config-router)# network 10.0.0.0
e- Shows the routing table
@Router0
Router# show ip route
@Router1
Router# show ip route
➔ Please perform the physical topology as shown in the
experiment 1.
Comment:
------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
24
Experiment 3
Link State Routing Protocol (OSPF)
Objective
To understand and apply Dynamic Routing Protocol (RIP, OSPF, EIGRP).
Tools and equipments
• PC
• Packet Tracer
25
Procedures
1- Perform the following topology
The IP Addresses are:
LAN 1: 1.0.0.0/8
LAN2: 2.0.0.0/8
NET 1: 10.0.0.0/8
26
a- Assign IPs for the PCs
PC0:
Click on PC, and then select a desktop tap
Then click on IP Configuration
And set
IPV4 Address, Subnet mask, and default gateway as the below picture
For PC1:
27
IP: 1.0.0.3
Subnet mask: 255.0.0.0
Default Gateway: 1.0.0.1
For PC2:
IP: 2.0.0.2
Subnet mask: 255.0.0.0
Default Gateway: 2.0.0.1
For PC2:
IP: 2.0.0.3
Subnet mask: 255.0.0.0
Default Gateway: 2.0.0.1
28
b- Assign IPs for the Interfaces of the Routers
Log on the Router0 as described in Lab 4
@Router0
Router> enable
Router# Configure terminal
Router(config)# interface g0/0
Router(config-if)# no shutdown
Router(config-if)# ip address 1.0.0.1 255.0.0.0
Router(config-if)# exit
Router(config)# interface g0/1
Router(config-if)# no shutdown
Router(config-if)# ip address 10.0.0.1 255.0.0.0
Router(config-if)# exit
Log on the Router1 as described in Lab 4
@Router1
Router> enable
Router# Configure terminal
Router(config)# interface g0/0
Router(config-if)# no shutdown
Router(config-if)# ip address 2.0.0.1 255.0.0.0
Router(config-if)# exit
Router(config)# interface g0/1
Router(config-if)# no shutdown
Router(config-if)# ip address 10.0.0.2 255.0.0.0
Router(config-if)# exit
c- Shows the routing table
@Router0
Router# show ip route
@Router1
Router# show ip route
29
d- Adding OSPF routing protocol
@Router0
Router(config)# router ospf 10
Router(config-router)# network 1.0.0.0 0.255.255.255 area 0
Router(config-router)# network 10.0.0.0 0.255.255.255 area 0
@Router1
Router(config)# router ospf 10
Router(config-router)# network 2.0.0.0 0.255.255.255 area 0
Router(config-router)# network 10.0.0.0 0.255.255.255 area 0
e- Shows the routing table
@Router0
Router# show ip route
@Router1
Router# show ip route
Please perform the physical topology as shown in the
experiment 1.
Comment:
------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
30
Experiment 4
Link State Routing Protocol (EIGRP)
Objective
To understand and apply Dynamic Routing Protocol (RIP, OSPF, EIGRP).
Tools and equipments
• PC
• Packet Tracer
31
Procedures
2- Perform the following topology
The IP Addresses are:
LAN 1: 1.0.0.0/8
LAN2: 2.0.0.0/8
NET 1: 10.0.0.0/8
32
f- Assign IPs for the PCs
PC0:
Click on PC, and then select a desktop tap
Then click on IP Configuration
And set
IPV4 Address, Subnet mask, and default gateway as the below picture
For PC1:
33
IP: 1.0.0.3
Subnet mask: 255.0.0.0
Default Gateway: 1.0.0.1
For PC2:
IP: 2.0.0.2
Subnet mask: 255.0.0.0
Default Gateway: 2.0.0.1
For PC2:
IP: 2.0.0.3
Subnet mask: 255.0.0.0
Default Gateway: 2.0.0.1
34
g- Assign IPs for the Interfaces of the Routers
Log on the Router0 as described in Lab 4
@Router0
Router> enable
Router# Configure terminal
Router(config)# interface g0/0
Router(config-if)# no shutdown
Router(config-if)# ip address 1.0.0.1 255.0.0.0
Router(config-if)# exit
Router(config)# interface g0/1
Router(config-if)# no shutdown
Router(config-if)# ip address 10.0.0.1 255.0.0.0
Router(config-if)# exit
Log on the Router1 as described in Lab 4
@Router1
Router> enable
Router# Configure terminal
Router(config)# interface g0/0
Router(config-if)# no shutdown
Router(config-if)# ip address 2.0.0.1 255.0.0.0
Router(config-if)# exit
Router(config)# interface g0/1
Router(config-if)# no shutdown
Router(config-if)# ip address 10.0.0.2 255.0.0.0
Router(config-if)# exit
h- Shows the routing table
@Router0
Router# show ip route
@Router1
Router# show ip route
35
i- Adding EIGRP routing protocol
@Router0
Router(config)# router eigrp 10
Router(config-router)# network 1.0.0.0 0.255.255.255
Router(config-router)# network 10.0.0.0 0.255.255.255
@Router1
Router(config)# router eigrp 10
Router(config-router)# network 2.0.0.0 0.255.255.255
Router(config-router)# network 10.0.0.0 0.255.255.255
j- Shows the routing table
@Router0
Router# show ip route
@Router1
Router# show ip route
Please perform the physical topology as shown in the
experiment 1.
Comment:
------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
36
Experiment 5
VLANs
Objective
To understand and apply VLANs.
Tools and equipments
• PC
• Packet Tracer
37
Procedures
1- Perform the following topology
38
The IP Addresses are:
VLAN 10: 10.0.0.0/8
VLAN 20: 20.0.0.0/8
VLAN 30: 30.0.0.0/8
VLAN 40: 40.0.0.0/8
NET. 1: 11.0.0.0/8
a- Assign IPs for the PCs
For PC0:
IP: 10.0.0.2
Subnet mask: 255.0.0.0
Default Gateway: 10.0.0.1
For PC1:
IP: 10.0.0.3
Subnet mask: 255.0.0.0
Default Gateway: 10.0.0.1
For PC2:
IP: 20.0.0.2
Subnet mask: 255.0.0.0
Default Gateway: 20.0.0.1
For PC3:
IP: 20.0.0.3
Subnet mask: 255.0.0.0
Default Gateway: 20.0.0.1
39
For PC4:
IP: 30.0.0.2
Subnet mask: 255.0.0.0
Default Gateway: 30.0.0.1
For PC5:
IP: 30.0.0.3
Subnet mask: 255.0.0.0
Default Gateway: 30.0.0.1
For PC6:
IP: 40.0.0.2
Subnet mask: 255.0.0.0
Default Gateway: 40.0.0.1
For PC7:
IP: 40.0.0.2
Subnet mask: 255.0.0.0
Default Gateway: 40.0.0.1
b- Switch Configuration
Log on the Switch 0 as described in Lab 4
@Switch 0
Switch > enable
Switch # conf t
Switch(config)# vlan 10
Switch(config-vlan)# exit
Switch(config)# vlan 20
Switch(config-vlan)# exit
Switch(config)# interface f0/1
Switch(config-if)# switchport access vlan 10
Switch(config-if)# exit
Switch(config)# interface f0/2
Switch(config-if)# switchport access vlan 10
Switch(config-if)# exit
Switch(config)# interface f0/3
40
Switch(config-if)# switchport access vlan 20
Switch(config-if)# exit
Switch(config)# interface f0/4
Switch(config-if)# switchport access vlan 20
Switch(config-if)# exit
Switch(config)# interface g0/1
Switch(config-if)# switchport mode trunk
Switch(config-if)# exit
Log on the Switch 1 as described in Lab 4
@Switch 1
Switch > enable
Switch # conf t
Switch(config)# vlan 30
Switch(config-vlan)# exit
Switch(config)# vlan 40
Switch(config-vlan)# exit
Switch(config)# interface f0/1
Switch(config-if)# switchport access vlan 30
Switch(config-if)# exit
Switch(config)# interface f0/2
Switch(config-if)# switchport access vlan 30
Switch(config-if)# exit
Switch(config)# interface f0/3
Switch(config-if)# switchport access vlan 40
Switch(config-if)# exit
Switch(config)# interface f0/4
Switch(config-if)# switchport access vlan 40
Switch(config-if)# exit
Switch(config)# interface g0/1
Switch(config-if)# switchport mode trunk
Switch(config-if)# exit
c- Assign IPs for the Interfaces of the Routers
Log on the Router0 as described in Lab 4
@Router0
41
Router> enable
Router# Configure terminal
Router(config)# interface g0/0
Router(config-if)# no shutdown
Router(config-if)# exit
Router(config)# interface g0/0.10
Router(config-subif)# encapsulation dot1q 10
Router(config-subif)# ip address 10.0.0.1 255.0.0.0
Router(config-subif)# exit
Router(config)# interface g0/0.20
Router(config-subif)# encapsulation dot1q 20
Router(config-subif)# ip address 20.0.0.1 255.0.0.0
Router(config)# interface g0/1
Router(config-if)# no shutdown
Router(config-if)# ip address 11.0.0.1 255.0.0.0
Router(config-if)# exit
Log on the Router1 as described in Lab 4
@Router1
Router> enable
Router# Configure terminal
Router(config)# interface g0/0
Router(config-if)# no shutdown
Router(config-if)# exit
Router(config)# interface g0/0.30
Router(config-subif)# encapsulation dot1q 30
Router(config-subif)# ip address 30.0.0.1 255.0.0.0
Router(config-subif)# exit
Router(config)# interface g0/0.40
Router(config-subif)# encapsulation dot1q 40
Router(config-subif)# ip address 40.0.0.1 255.0.0.0
42
Router(config)# interface g0/1
Router(config-if)# no shutdown
Router(config-if)# ip address 11.0.0.2 255.0.0.0
Router(config-if)# exit
d- Shows the routing table
@Router0
Router# show ip route
@Router1
Router# show ip route
e- Adding OSPF routing protocol
@Router0
Router(confi)# router ospf 10
Router(config-router)# network 10.0.0.0 0.255.255.255 area 0
Router(config-router)# network 11.0.0.0 0.255.255.255 area 0
Router(config-router)# network 20.0.0.0 0.255.255.255 area 0
@Router1
Router(confi)# router ospf 10
Router(config-router)# network 11.0.0.0 0.255.255.255 area 0
Router(config-router)# network 30.0.0.0 0.255.255.255 area 0
Router(config-router)# network 40.0.0.0 0.255.255.255 area 0
f- Shows the routing table
@Router0
Router# show ip route
@Router1
43
Router# show ip route
g- Adding EIGRP routing protocol
@Router0
Router(confi)# router eigrp 10
Router(config-router)# network 10.0.0.0 0.255.255.255
Router(config-router)# network 11.0.0.0 0.255.255.255
Router(config-router)# network 20.0.0.0 0.255.255.255
@Router1
Router(confi)# router eigrp 10
Router(config-router)# network 11.0.0.0 0.255.255.255
Router(config-router)# network 30.0.0.0 0.255.255.255
Router(config-router)# network 40.0.0.0 0.255.255.255
h- Shows the routing table
@Router0
Router# show ip route
@Router1
Router# show ip route
Comment:
------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
44
Experiment 6
VLAN Trunking Protocol (VTP)
Objective
To understand and apply VTP.
Tools and equipments
• PC
• Packet Tracer
45
Procedures
2- Perform the following topology
46
VTP is a protocol used to manage the VLANs in all switches in the same domain, the
switch in the domain can be server, transparent, or client.
Server Transparent Client
Can create and delete Can create and delete Cannot create and delete
VLANs in the domain VLANs locally only VLANs in the domain
Doesn’t Synchronize the
Synchronize the VLAN Synchronize the VLAN
VLAN database in the
database in the domain database in the domain
domain
Forward Advertisement Forward Advertisement Forward Advertisement
In our example, switch 0 is a server switch, switch 1 is a transparent switch, and switch 2
is a client switch.
@Switch0
Switch> enable
Switch# conf t
Switch(config)#vtp mode server
Switch(config)#vtp domain FEHU
Switch(config)#vtp password 123
@Switch1
Switch> enable
Switch# conf t
Switch(config)#vtp mode transparent
Switch(config)#vtp domain FEHU
Switch(config)#vtp password 123
47
@Switch2
Switch> enable
Switch# conf t
Switch(config)#vtp mode client
Switch(config)#vtp domain FEHU
Switch(config)#vtp password 123
@Switch0
Switch#show vlan
Switch#show vtp status
@Switch1
Switch#show vlan
Switch#show vtp status
@Switch2
Switch#show vlan
Switch#show vtp status
@Switch0
Switch(config)#vlan 10
@Switch0
Switch#show vlan
Switch#show vtp status
@Switch1
Switch#show vlan
Switch#show vtp status
@Switch2
Switch#show vlan
Switch#show vtp status
48
Comment:
------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
49
Experiment 7
Dynamic Trunking Protocol (DTP)
Objective
To understand and apply DTP.
Tools and equipments
• PC
• Packet Tracer
50
Procedures
DTP is a protocol to configure the port automatically to be trunked between switches,
the port switch has 4 modes:
Dynamic desirable, dynamic auto, access, trunk.
Switch-1 (port 1) (Switch-2) port 2 Operational Mode
Dynamic desirable access access
Dynamic auto access access
Trunk access Invalid
Trunk Dynamic auto Trunk
Dynamic desirable Dynamic auto Trunk
Dynamic desirable Dynamic desirable Trunk
Dynamic auto Dynamic desirable Trunk
Trunk Dynamic desirable Trunk
Trunk Trunk Trunk
By default the interface of the switch is in mode of Dynamic auto, to change the mode
of the interface
@Switch0
Switch> enable
Switch# conf t
Switch(config)#interface GigabitEthernet0/1
//to make it in the access mode
Switch(config-if)#switchport mode access
//to make it in the dynamic desirable mode
Switch(config-if)#switchport mode dynamic desirable
//to make it in the dynamic auto mode
Switch(config-if)#switchport mode dynamic auto
//to make it in the trunk mode
Switch(config-if)#switchport mode trunk
51
//to display the operational mode and the administrative mode (configured) of the
interface
Switch#show interface switchport
Comment:
------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
52
Experiment 8
Spanning Tree Protocol (STP)
Objective
To understand and apply STP Protocol.
Tools and equipments
• PC
• Packet Tracer
53
Procedures
Apply the following topology:
A- Electing the root bridge (all ports of root bridge are in the forwarding state)
The election based on:-
1- Switch with the least switch ID: (Switch priority + Switch MAC Address)
Switch priority consists of 2 bytes (0 → 65535)
B- Electing the root port on the non-root switch: each non-root switch is electing the
best port to reach the root switch based on:
54
1- The port that has the least accumulated path cost to the root switch based on
the BW.
2- Port connected to the least neighbor (Switch ID).
3- Port connected to least neighbor port ID.
C- Electing the designated port: it is the best port in each link that can reach to the root
switch based on:
1- The port that has the least accumulated path cost to the root switch based on the
BW.
2- Port connected to the least neighbor (Switch ID).
3- Port connected to least neighbor port ID.
//to show spanning tree status
Switch# show spanning-tree
Example for the show of the root bridge
Example for the show of the non-root bridge, but all ports are in forwarding state
55
Example for the show of the non-root bridge, has a blocked interface
Comment:
------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
56