Network Lab Notes Final
Network Lab Notes Final
ّ.ّّوزدناّعلما،ّوانفعناّبماّعلمّتنا،اللّهمّعلمناّماّينفعنا
Exp #1
❖ Network cables
• Unshielded twisted pair
• Shielded twisted pair
• Coaxial cable
• Fiber optic.
❖ Cable connections
❖ Straight through cable (for dissimilar devices e.g. switch-router, pc-switch …)
This would be an Ethernet- only cable and would not work with Voice, Token Ring, ISDN, etc.
Note that only pins 1, 2, 3, and 6 are used. Just connect 1 to 1, 2 to 2, 3 to 3, and 6 to 6, and you
will be up and networking.
❖ Cross-over cable (for similar devices and with some exceptions [switch and hub, Router and PC])
❖ Roll-over cable (to connect the router/switch to the PC via console port for management purposes)
Notice that the left wire colors are the same as the Straight through cable.
1
This part is called an “RJ45” connecter.
➢ To check network interface card (NIC) in a pc → “Ping 127.0.0.1” This is the diagnostic or loopback
address, or type “Ping localhost”.
➢ Note that newly Operating systems and computers nowadays detect the cable types, so now there is no
need to care a lot about the cable type.
❖ Commands
❖ IPCONFIG Command
This command is used to get IP configurations present in your PC.
❖ PING Command
This command is used diagnostically to ensure that a host computer you are trying to reach is
exist, can accept requests and is actually operating.
❖ TRACERT Command
This command is used to determine which way does the data (packet) goes and through which
devices.
In UNIX machines it is called traceroute, in Windows machines it is called tracert.
2
❖ Enhanced Ping
TJPing is a fast, multithreaded ping/lookup/traceroute utility for Windows
(95/98/Me/NT/2000/XP). It’s fully configurable, remembers settings between sessions, and
allows users to log results to a file of their choice.
❖ NETSTAT Command
This command is used to get information about the open connections on your system (ports,
protocols being used, etc.), incoming and outgoing data and also the ports of remote systems
to which you are connected.
3
Extra
❖ Subnetting
4
OSI model layers.
❖ Why layering
❖ Troubleshooting: easier.
❖ Change: change in one-layer, other layers are not affected.
❖ Design: division into layers makes the solution much simple.
❖ Learning: understanding the network communication as layers is easier.
5
EXP #2 - Static Routing
When devices are connected through a switch (one network), packets are transferred without the need for
routing protocols. However, if routers are used to connect networks to each other, routing protocols are
required to transfer packets from one network to another.
❖ Cisco routers
The Cisco Internetwork Operating System (IOS) is the kernel of Cisco routers and most switches. IOS
was created to deliver network services and enable networked applications.
The important things that the Cisco router IOS software is responsible for:
• Carrying network protocols and functions.
• Connecting high-speed traffic between devices.
• Adding security to control access and stop unauthorized network use.
• Providing scalability for ease of network growth and redundancy.
• Supplying network reliability for connecting to network resources.
❖ Types of routing
There are two main types of routing protocols, static and dynamic.
In static routing, it is the role of the administrator to update the router with new routing information
(add segment or remove a segment).
• Pros of static routing:
➢ There is no overhead on the router's CPU, meaning a cheaper router can perform the job
effectively compared to using dynamic routing.
➢ There is no bandwidth usage between routers, this means that money could potentially be
saved on WAN links.
➢ It adds security because the administrator can choose to allow routing access to certain
networks only.
In Dynamic routing the routing information will be updated automatically. A protocol on one router
communicates with the same protocol running on neighbor routers.
❖ CLI modes
• User mode (Router>): is mostly used to view statistics, but it is also a stepping-stone to
logging into privileged mode by typing “enable”.
• privileged mode (Router#): is used to view and change the configuration of a Cisco router.
• global configuration mode (Router (config)#): At this point, you make changes that affect
the router as a whole.
7
❖ Telnet and passwords
As mentioned before, Telnet is a terminal emulation program that acts as though it is a
dumb terminal. Telnet can be used to connect to any active interface on a router like an
Ethernet or serial port.
Telnet is not enabled by default; to enable it with a password, the following commands
must be typed in configuration mode
After this, Telnet will be enabled on the router’s interfaces, and the specified password will
be required for access. Password 2 is required when typing “enable”.
8
الجزءّالعملي
راحّيكونّالشرحّفيّاألجزاءّالعمليةّبالعربي؛ّعشانّأسرعّوأوضحّ.
ضّ،طبّكيفّممكنّاعملّهيك؟ّعنّطريقّالراوتنجّبرتوكولزّ. الفكرةّمنّهايّالتجربةّإنهّّنخليّالراوترزّيتواصلواّمعّبع ّ
إذاّكانّعناّأكثرّمنّشبكةّ،البدّمنّاستخدامّطريقةّعشانّنعرّفّكلّراوترّإنهّإذاّأجىّالباكيتّالفالنيّمنّالراوترّالفالنيّ
وجهليّإياهّإلىّالمكانّالفالّني.
ي)ّلكلّجهازّمنّاألجهزةّ،وكذلكّلكلّانترفيسّبديّ
طبعاّعشانّنبدأّفيّهايّالتجربةّ،أولّاشيّالزمّأعملهّإنهّأعطيّ(ايّب ّ
أستخدمهّفيّالراوترزّوالزمّماّأنسىّإنهّأفعلّهذاّاالنترفيس.
هساّبديّأعرّفّال(راوتنجّبروتوكول)ّعلىّكلّالراوترزّ–ّفيّحالتناّهونّ(ستاتكّراوتنج)ّ،عنّطريقّهذاّالكوماندّ.
ّمعنىّهذاّالكوماندّّ:إذاّأجتّأيّباكيتّعلىّهذاّالراوترّبدهاّتروحّعلىّالشبكةّاليّهيّdestination_network
ّمعّال(سبنت)ّّتبعهاّ،ارسلهاّعنّطريّقّّّnext-hop_addressإليّهوّبمثلّاالنترفيسّالقادمةّإليّراحّيتوجهلها.
موضوعّتفعيلّالّ(ّ)telnetووضعّباسووردّوماّإلىّ ّذلكّ،تمتّتغطيتهّفيّالصفحةّالسابقةّ.
9
لّroutingبحيثّإنكمّترسلواّمنّاليمينّللشمال
فيّمالحظةّمهمةّحاببّأّنوهلهاّ،إ ّذاّطلبّمنكمّإنوّتزبّطواّا ّ
ّهساّهونّفشّطريقّمباشرّبينّاليمينّوالشمالّ،فاّبنضطرّأنهّنعملّال ّRoutingعلىّأكثرّمنّمرحلة
أولّإشيّبحطّإنهّأيّبكتّمنّاليمينّاذاّبدهّيوصلّالشمالّ،ارسلهّعنّطريقّاالنترفيسّالقريبةّعلىّاليمينّ(ّالراوترّاليّ
عنّطريقّاالّنترفيسّاليّعلىّ ص)ّ،ومنّثمّعلىّالراوترّاليّبالنصّ،بحطّانهّايّبكتّبدهاّتوصلّإلىّالشمالّ،تروحّ ّبالن ّ
الشمالّ(الراوترّإليّعلىّالشمال)ّ،وبهيكّبصيرّايّبكتّمنّاليمينّبدهّيروحّعلىّالشمالّيمرّبالراوترّاليّبالنصّ،وهذاّ
الراوترّبوجههّإلىّالطريقّالصحيحّ.
10
EXPs #3-4-5 - Dynamic Routing
❖ Dynamic routing classification
• Interior and exterior gateway routing protocols: Interior protocols include RIP, EIGRP and
OSPF. Exterior protocols include BGP.
• Distance vector, path vector and link state routing protocols: RIP and EIGRP are distance
vector. BGP is path vector. OSPF is link state.
• Classful and classless: RIP and EIGRP [1] are classful while OSPF is classless.
❖ Differences between Distance vector, path vector and link state routing protocols
In distance vector routing Protocols at the beginning each node (router) has only routing information
about its direct neighbors. Each router broadcast periodically its routing information to its neighbors.
This way, eventually, each node will get information about the entire network. This is called routing
by rumor, because a router receiving an update from a neighbor router believes the information about
remote networks without finding out for itself.
link-state routing protocol calls for sending of link-state advertisements (LSAs) to all other routers
within the same area. As OSPF routers accumulate link-state information, they use the shortest path
first algorithm (SPF) -Dijkstra’s algorithm- to calculate the shortest path to each node. Then, they
share this information with the entire area.
Path vector protocols determine the best path based on the sequence of autonomous systems (ASs)
that data must pass through to reach a destination. The entire path (AS path) is considered when
making routing decisions.
[1]: According to Wikipedia, IGRP is classful while EIGRP is classless. However, the manual indicates that EIGRP is classful.
11
Administrative Distance table
Route Source Administrative Distance (AD)
12
❖ Open shortest path first (OSPF)
OSPF allows packet authentication and uses IP multicast when sending/receiving packets. it has two
primary characteristics, the first is that the protocol is open. The second is that it is based on SPF
algorithm (Dijkstra algorithm).
OSPF is the routing protocol of choice when:
• There are routers from vendors other that Cisco in the network.
• The network requires segmentation into areas or zones.
OSPF uses bandwidth as metric (cost). It uses a reference bandwidth of 100 Mbps for cost
calculation (fixed). The formula to calculate the cost is reference bandwidth divided by interface
100𝑀𝑏𝑝𝑠
bandwidth 𝑐𝑜𝑠𝑡 = 𝐵𝑎𝑛𝑑𝑊𝑖𝑑𝑡ℎ 𝑜𝑓 𝑡ℎ𝑒 𝑙𝑖𝑛𝑘 . Thus, a 100Mbps link has a metric of 1; a 10Mbps link has a
metric of 10; a 1Gbps (or faster) link also has a cost of 1 because the cost cannot be lower than 1.
The cost for each link in the path is added together to form a metric for the route.
➢ Route Summarization
Route summarization is the process of replacing a series of routes with a summary route and a
mask. This lessens the size of routing update packet itself and makes the routing table smaller,
yet still allow for complete IP connectivity when done correctly. In, the 6 more specific routes in
router 0 as shown in the Figure bellow (i.e. 192.168.0.0/24, 192.168.1.0/24, 192.168.2.0 …. and
192.168.5.0/24) can be replaced by two summary routes which are 192.168.0.0/22 and
192.168.4.0/23.
Not that we cannot replace the 6 networks using 21 subnet mask and id 192.168.0.0/21 with one
subnet because this network includes smaller subnets that are not connected to router 1 as
192.168.6.0/24 and 192.168.7.0/24.
13
➢ Routing Hierarchy
Unlike RIP, OSPF can operate within a hierarchy. The largest entity within the hierarchy is the
autonomous system (AS), which is a collection of networks under a common administration that
share a common routing strategy.
An AS can be divided into a number of areas, which are groups of contiguous networks and
attached hosts. Routers with multiple interfaces can participate in multiple areas. These routers,
which are called Area Border Routers (ABRs), maintain separate topological databases for each
area.
An area's topology is hidden from entities outside it, reducing OSPF routing traffic. OSPF uses
intra-area routing when the source and destination are within the same area, and inter-area routing
when they are in different areas.
An OSPF backbone which is called area 0 is responsible for distributing routing information
between areas. It consists of all area border routers, networks not wholly contained in any area,
and their attached routers shows an area design diagram.
The backbone area forms the central hub of an OSPF network. All other areas are connected to
it, and inter-area routing happens via routers connected to the backbone area and to their own
non-backbone areas. The backbone must be adjacent to all other areas, but does not need to be
physically contiguous. All OSPF areas must connect to the backbone area. This connection,
however, can be through a virtual link.
➢ Router ID
If there are no loopback IPs on the router, the router ID will be the highest IP address of any active
interface. However, if the router has loopback IPs, the router ID will be the highest loopback IP address.
14
❖ Border Gateway Protocol (BGP)
BGP Version 4 (BGPv4) is the current standard deployment. it is the routing protocol of choice on the
Internet. Essentially, the Internet is a collection of interconnected Autonomous Systems. Its Autonomous
Systems are assigned an Autonomous System Number (ASN), which is a 16-bit number ranging from 1 –
65535. A specific subset of this range, 64512 – 65535, has been reserved for private (or internal) use.
BGP’s true benefit is in controlling how traffic enters the local AS, rather than how traffic exits it.
For BGP to function, BGP routers (called speakers) must form neighbor relationships (called peers).
There are two types of BGP neighbor relationships:
• iBGP Peers – BGP neighbors within the same autonomous system.
• eBGP Peers – BGP neighbors connecting separate autonomous systems.
Once BGP peers form a neighbor relationship, they share their full routing table. A Cisco router running BGP
can belong to only one AS. The IOS will only allow one BGP process to run on a router.
▪ KEEPALIVE messages: these are sent periodically (every 60 seconds by default) to ensure that
the remote peer is still available. If a router does not receive a KEEPALIVE from a peer for a
Hold-time period (by default, 180 seconds), the router declares that peer dead. To globally adjust
the KEEPALIVE and Hold-time timers for all neighbors:
If a peer session is stuck in an Active state, potential problems can include: no IP connectivity, an incorrect neighbor
statement, or an access-list filtering TCP port 179.
15
الجزءّالعمليّ
>Router(config-router)#ّnetwork <ID-OF-CONNECTED-NETWORKS
16
OSPF -2
عشانّأطبقّالّOSPFعلىّالرواترزّبستخدمّهذاّالكوماندّ
تّ،عنّطريقّهذاّالكوماندّ
بعدينّببلّشّأضيفّالشبكاتّالمجاورةّزيّالتجربةّإليّقبلّولكنّمعّإضافةّبعضّالمعلوما ّ
بّعكسّالّSubnet mask
ّطبعاّزيّماّبتعرفواّإنهّالWILDCARDبّنكّتّ ّ
إذاّكانّفيّّloopbackالزمّنضّيفهمّعلىّال ّOSPFفيّنفسّالراوترّفقط.
طبيقّهذاّاألمر
لتغييرّا ّل ّCostتبعّ Linkمعينّ،عنّطريقّأحسبّال ّCostعنّطريقّالمعادلةّالتيّتمّذكرهاّسابقاّومنّثمّت ّ
علىّا ّل ّInterfaceالمرادّالتعديلّعليه
>Router(config-if)#bandwidth <BANDWIDTH-IN-KILOBITS
للا.
بالنسبةّلموضوعّالّ Summarizationشوفوهّمنّالالبّمانيوالّ،بسيطّّانّشاءّ ّ
17
BGP -3
بعدينّبروحّعلىّالراوترزّإليّعلىّاألطرافّعشانّأعرفّعليهمّالّBGPعنّطريقّهذاّالكوماند
AS-NUMBERهونّبتمثلّرقمّالّّAutonyms systemإليّالراوترّبكونّفيهاّ.
بعدينّبدناّنعرفّالجيرانّتبعونهّعنّطريقّهذاّالكوماند
لBGP
وهذاّالكوماندّلماّنكونّداخلينّعلىّا ّ
18
EXP #6 - Access Control Lists
For this experiment, Dr. Ibrahim sent us these slides:
(https://drive.google.com/file/d/1jaznkpEmGPIEAyNjC_eCTr4OUWNcMDGe/view?usp=sharing). They are
very useful and helpful, check them.
ّالجزءّالعملي
ببلشّتنفيذهمّمنّفوقّإلىAccess control entriesّحطّفيّبالكّإنهّعندّتنفيذّال،هونّبديّبسّأنوهّعلىّمالحظةّمهمةّجدا
ّ.ّخلّيّاإلشيّالخاصّباألوّلّثمّّاإلشيّالعام،ّفاّالترتيبّهونّمهمّجدا،تحتّعلىّالترتيب
19
EXPs #7-8 - Vlans
For this experiment, only the practical part is included – check the theoretical part in the lab manual.
الجزءّالعمليّ
الخطواتّالعامةّإذاّكانّمطلوبّمنيّأعملّ:vlans
ّّّّّّّّّّّّّّّ.
ّ،ّTrunkوهمّأيّمدخلّمهوشّمشبوكّعلىّEnd device
ّّّّّّّّّّّّّّّّ
portsّforّّّّّّّّّ-1أعرفّالّّّّّّّ
switches
ّ-2أعرفّالبورتسّالمستخدمةّفيّالراوترزّ،إذاّكانّالبورتّبشبكّبينّراوترزّبسّ،بنعطيهّIP
ّّّعاديّزيّماّكناّنعملّ
ّّّّّّّّّّّّّّّّّّّّّّعنّطريقّكتابةّ
ّّّّّّّّ،بدخلّعلىّالVirtual interface
ّّّّّّّّّوعليهّvlans
زمانّ،ولكنّإذاّالبورتّكانّمشبوكّعلىّswitch
يّالّّّّّّّّّّّّّنفسّإليّموجودةّعلىّال
topology VLAN-ID والّّّّّّّّّّّّّّّّّّّّّّّّّّمشّشرطّيكونواّنفسّالرقمّ،المهمّإنهّنخل
Sub interface number ّّّّّّّّّّّّ
الّVLAN-ID
ّgateway
ّّّّّّّّّلبعضّاالجهزةّ،فاّإنزلّوحطهّمكانّالّّّّّّّّّّ
ّIPراحّيكونّgateway
ّّّّّّّّّّّّ
ّ،ّinterfaceهذاّال address
ّّّّّّّّّّّّّّّّّّّّّّّّّّّّ
وبعدينّبعطيّIP addressلهذاّال
ّّّّّّكشبكةّلحالّفيّهذاّ
ّّّّّّّّّّّّّّّّّّّّالمطلوبّزيّماّتعلمناّسابقاّ،وماّتنسىّتحطّكلّvlan
فيّهذهّاألجهزةّ.ومنّثمّبعملّالRouting Protocol
البروتوكول.
ّّّّّّعلىّهذاّالسويتشّ،
ّّّّّّّإليّبالشّبكةّكاملةّ،عشانّممكنّيمرّباكيتّمنّهايّالvlan ّ-3بنزلّعلىّال switches
ّّّّّّّّّّّّ،بعرفّكلّال vlans
ّvlan
ّّّّّّّّّّّّللسويتشّايشّالّّّّّ
ّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّ.وظلّأعرفّكلّ interface
ّّّّّّّّّّّّّّVlan <vlanID> then exit and repeat for all vlansّ،
عنّطريقّال commands
ّ.Switchport
ّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّّ
المشبوكّعليهاّعنّطريقّهذاّالكوماندّ>access vlan <vlanID
وهيكّبكونّالتلخيصّجاهزّبإذنّللاّ،بالنسبةّلّخرّتجربتينّسهالتّكثيرّانّشاءّللاّ،يعنيّماّبوخذواّمعكمّ
وقتّفيّدراستهمّمنّالمانيوالّ،الّتنسوناّمنّصالحّدعائكمّ،بالتوفيقّ.
والحمدهللّربّالعالمينّ
20