0% found this document useful (0 votes)
24 views4 pages

LAB01

Uploaded by

Bekhedda Asma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views4 pages

LAB01

Uploaded by

Bekhedda Asma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Intelligent Systems Engineering Department

The National School of Artificial Intelligence


3rd Year, Semester 1 — 2024/2025

NETWORKS AND PROTOCOLS

Lab 01
Objectives
Get you familiar with basic networking tools.

Exercise 01: ifconfig (Network interfaces and their names)


The ifconfig utility lists a computer’s network interfaces and displays or updates their config-
uration. Type ifconfig in the command line and answer the following questions:
Note that the equivalent command in Windows is ipconfig.

(a) How many network interfaces does your computer have?

(b) Can you guess why it has more than one?

(c) What is the IP address of each interface?

(d) What is the MAC address of each interface?

(e) Why could it be that some interfaces do not have a MAC address?

Exercise 02: Use ping to test host reachability


Are the following hosts reachable from your machine by using ping:

• www.ensia.edu.dz • www.algeria.dz • www.kremlin.ru


• www.cerist.com • www.hola.hp • 8.8.8.8
• www.mit.edu • www.amazon.com
• www.intel.com • www.tsinghua.edu.cn

If you observe that some hosts are not reachable, then can you explain why? Check if the ad-
dresses that were unreachable by the ping command are reachable from the Web browser (here
you should use the website’s URL instead of the IP address).

Here are some of ping options for Windows :

• -t: Sends packets continuously until the user interrupts.

Copyright © A. Bachir, A. Bensalem, A. Djouama, K. Lounis, Y. Sahraoui 2024/2025.


• -n count: Sends count packets, then stops.

• -l packetsize: Specifies packet size in bytes.

• -w timeout: Sets the timeout in seconds for each request

Here are some of ping options for Unix-like operating systems:

• -c count: Sends count packets, then stops.

• -s packetsize: Specifies packet size in bytes.

• -i timeout: Sets the timeout in seconds for each request

• -o: Exit successfully after receiving one reply packet.

• -a Include a bell character in the output when any packet is received.

Exercise 03: Use traceroute to understand network topology


When two computers (end-systems) communicate with each other over the Internet, their com-
munication traverses multiple packet switches. There are two general types of packet switches
on the Internet: link-layer switches and network-layer switches (the latter are also called routers).

The traceroute utility lists the routers that are located between your computer and a remote
one. E.g., if you type traceroute <target> in the command line, where <target> is a website
name or IP address, it will display a list of router names and/or IP addresses and the RTTs
(Round Trip Times) that were measured between your computer and each router.

(a) Run traceroute on your machine to www.mit.edu

(b) How many routers are there between your workstation and www.mit.edu ?

(c) Between which two routers do packets cross the Atlantic Ocean?

Run traceroute from your machine to the following destinations: (I)www.ucla.edu (II)www.u-
tokyo.ac.jp and (III)www.lancaster.ac.uk.

(a) At which router do the paths from your machine to these three destinations diverge?

(b) Find out further details about this router.

(c) Is the number of hops on each path proportional to the physical distance?

Several servers distributed around the world provide a web interface from which you can perform
a traceroute to any other host in the Internet. Here are two examples:
(I) http://www.speedtest.com.sg/tr.php and (ii) https://www.telstra.net/cgi-bin/trace. You
can find other traceroute servers at www.traceroute.org

Copyright © A. Bachir, A. Bensalem, A. Djouama, K. Lounis, Y. Sahraoui 2024/2025.


(a) Run traceroute from both these servers towards your machine and in the reverse direction
(i.e. from your machine to these servers)

(b) What are the IP addresses of the two servers that you have chosen?

(c) Does the reverse path go through the same routers as the forward path?

(d) If you observe common routers between the forward and the reverse path, do you also
observe the same IP addresses? Why or why not?

The equivalent command in Windows is tracert.

Here is some of traceroute options in Windows:

• -d: Do not resolve addresses to hostnames.

• -h maxiHops: Maximum number of hops to search for target.

• You can introduce the packet size in tracert command, exp: tracert 1.1.1.1 133

Here is some of traceroute options in Unix-like operating systems:

• -m MaxHop: Sets the maximum number of hops used in outgoing probe packets.

• -n: Do not resolve addresses to hostnames.

• -q Nqueries: Specifies the number of probes the traceroute command sends at each hop.
The default is three probes.

• -v: Receives packets other than TIME EXCEEDED.

• -w WaitTime: Sets the time (in seconds) to wait for a response to a probe. The default is
3 seconds.

Exercise 04: Use ping to gain insights into network performance


For each of these locations (www.qu.edu.qa , www.nd.edu , www.imperial.ac.uk ) find the (ap-
proximate) physical distance from ENSIA using Google Maps and compute the shortest possible
time T for a packet to reach that location from ENSIA. You should assume that the packet moves
(i.e. propagates) at the speed of light, 3×108 m/s. Note that the shortest possible time will sim-
ply be the distance divided by the propagation speed. Plot a graph where the x-axis represents
the distance to each city (i.e. Doha, Indiana and London), and the y-axis represents the ratio
between the minimum delay (i.e. RTT) as measured by the ping program (select the values for
50 byte packets) and the shortest possible time T to reach that city from ENSIA. (Note that
the y-values are no smaller than 2 since it takes at least 2×T time for any packet to reach the
destination from ENSIA and get back).

(a) Can you think of at least two reasons why the y-axis values that you plot are greater than
2?
Copyright © A. Bachir, A. Bensalem, A. Djouama, K. Lounis, Y. Sahraoui 2024/2025.
(b) Is the delay to the destinations constant or does it vary over time? Explain why.
(c) The measured delay (i.e., the delay you can see in the graphs) is composed of propagation
delay, transmission delay, processing delay and queuing delay. Which of these delays
depend on the packet size and which do not?
Exercise 05: dig
Humans use special names to refer to computers (more precisely, to the network interfaces of
computers). When you instruct your computer to communicate with a remote computer that
has a given name, your computer translates the given name to an IP address.
• What are the IP addresses of www.ensia.edu.dz?
• What are the IP addresses of www.yahoo.fr ?
– Why could it be that www.yahoo.fr maps to more than one IP addresses?
• What is the IP address of www.google.com?
• Answer the same question again in an hour or so. Has anything changed? If so,
– What could be the reason for the change?
– Which is the IP address of the Google site ( www.google.com )?
– n your opinion, what is the reason of having several IP addresses as an output?
• Find out name of the IP address 127.0.0.1. What is special about this IP address
The equivalent command in windows is nslookup.

Exercise 06: netstat


The netstat command is used to display the TCP/IP network protocol statistics and informa-
tion. To use it, tape netstat in the command line.
• What are the opened ports on your computer ?
• What are the remote addresses (or names) that communicate with your computer ?
Here are some netstat options:
• -a: Show the state of all sockets.
• -b: Show the number of bytes in and out.
• -m: Show statistics recorded by the memory management routines.
• -n: Show network addresses as numbers.
• -p protocol: Show statistics about protocol (ex: tcp/udp).
• -s: Show per-protocol statistics.

Copyright © A. Bachir, A. Bensalem, A. Djouama, K. Lounis, Y. Sahraoui 2024/2025.

You might also like