Computer Networks
Computer Networks
Spring 2024
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
5
Experiment 1
Static Routing
Objective
To understand and apply static routing.
6
Procedures
1- Perform the following topology
7
a- Assign IPs for the PCs
PC0:
Click on PC, and then select a desktop tap
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
@Router1
Router# show ip route
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
@Router1
Router# show ip route
11
The Physical Topology will be as is the following
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.
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.
16
11- The connections between two rooms
12- Perform the same previous steps for the second building
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).
19
Procedures
1- Perform the following topology
20
a- Assign IPs for the PCs
PC0:
Click on PC, and then select a desktop tap
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
@Router1
Router# show ip route
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
@Router1
Router# show ip route
Comment:
------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
24
Experiment 3
Link State Routing Protocol (OSPF)
Objective
To understand and apply Dynamic Routing Protocol (RIP, OSPF, EIGRP).
25
Procedures
1- Perform the following topology
26
a- Assign IPs for the PCs
PC0:
Click on PC, and then select a desktop tap
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
@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
@Router1
Router# show ip route
30
Experiment 4
Link State Routing Protocol (EIGRP)
Objective
To understand and apply Dynamic Routing Protocol (RIP, OSPF, EIGRP).
31
Procedures
2- Perform the following topology
32
f- Assign IPs for the PCs
PC0:
Click on PC, and then select a desktop tap
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
@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
@Router1
Router# show ip route
36
Experiment 5
VLANs
Objective
To understand and apply VLANs.
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
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
41
Router> enable
Router# Configure terminal
Router(config)# interface g0/0
Router(config-if)# no shutdown
Router(config-if)# exit
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
@Router1
Router# show ip route
@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
@Router1
43
Router# show ip route
@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
@Router1
Router# show ip route
Comment:
------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
44
Experiment 6
VLAN Trunking Protocol (VTP)
Objective
To understand and apply VTP.
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.
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.
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.
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
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.
53
Procedures
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.
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