You are on page 1of 4

Xarxes //Computer Networks 15 de Juny de 2023

Curs 2022/23 Examen Final //Final Exam


SOLUCIONS
Nom // Name: _______________________________________________________________

NIU: _______________________________________________________________________

Poseu en cada full nom i NIU // Write your name and NIU on each page

Duració/Time: 120’ 2.5 punts per exercici // 2.5 points each exercise

EXERCICI 1

Els hosts A i B intercanvien dades utilitzant TCP, seguint aquestes indicacions: // Hosts A and B
interchange data using TCP, following these indications:

1. A estableix la connexió amb B. // A establish the connection to B.


2. A envia 700 bytes de dades a B. // A sends 700 bytes of data to B.
3. Després de rebre 300 bytes, B envia 400. // After receiving 300 bytes, B sends 400.
4. S’utilitza l’últim segment de dades per a finalitzar la connexió (en A i en B). // The last
segment of data is used to finalise the connection (both in A and B).
5. Els segments indicats amb una X es perden. Les finestres són de 400 bytes. MTUa=373 i
MTUb=190. // Segments marked with an ‘X’ are lost. Windows are 400 bytes. MTUa=373
and MTUb=190.
6. El MTU mínim del camí entre A i B és 120. // The minimum MTU in the A-B path is 120.

Ompliu la taula amb tots els segments intercanviats. // Fill in the table with all the interchanged
segments.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
src
PA PB PA PA PA PA PB PB PB PA PA PA PB PA PB PA PB
port

dest
PB PA PB PB PB PB PA PA PA PB PB PB PA PB PA PB PA
port

SYN ACK ACK ACK ACK ACK


flags SYN ACK ACK ACK ACK ACK ACK ACK ACK ACK ACK
ACK FIN FIN FIN FIN FIN

#seq 20 60 21 21 171 321 61 211 361 321 471 621 361 621 462 621 462

#ack -- 21 61 61 61 61 321 321 321 361 361 361 621 462 722 462 722

data 0 0 0 150 150 100 150 150 100 150 150 100 100 100 0 100 0

lost X X X X
EXERCICI 2: Nom / Name & NIU: _____________________________

A envia unes dades a B a través d’una connexió TCP ja establerta en la xarxa de la figura, i B li respon
amb altres dades (2 segments en total, 1 en cada sentit). // A sends data to B using an already
established TCP connection in the network of the figure, and B replies with other data (2 segments
in total, 1 on each direction).

-La taula mostra, desordenats, els datagrames a la xarxa N4. // The table contains the datagrams at
N4, unordered.

-R1 re-envia datagrames a N2 i a N3 de manera alternada (el primer l’envia a N2, el següent a N3,
el següent a N2, etc.). // R1 alternatively forwards datagrams to N2 and N3 (first to N2, next to N3,
again to N2, and so on and so forth).

SRC DST ID Offset MF TTL Total length


DATAGRAMS @ N4

A B 55 248 1 62 268
(header 20 bytes)

B A 256 400 0 64 72
A B 55 0 1 62 268
B A 256 0 1 64 420
A B 55 880 0 62 40
A B 55 496 1 62 84
A B 55 560 1 62 340

a) Indiqueu els MTU mínims de les Xarxes N1-N4, que justifiquen els datagrames observats: //
Write the minimum MTU of the networks N1-N4, that justify the observed datagrams:

N1: 580 N2: 268 N3: 340 N4: 420

b) Reconstruïu els segments que arribaran finalment a la capa de transport (TCP) d’A i a B (utilitzeu
només les fileres necessàries). Inventeu les dades que necessiteu, però manteniu la coherència. //
Write the segments that will finally arrive to the transport layer (TCP) of A and B (use only the rows
you need): Invent the data you may require, but please keep coherence.

SRC DST Flags Total length Data length


(header: 20 bytes)
SEGMENTS

PA PB ACK 900 880


PB PA ACK 452 432
EXERCICI 3 Nom / Name & NIU: ________________________________

Hem de distribuir el bloc 72.14.14/23 entre les xarxes de la figura. // Block 72.14.14/23 has to be distributed
among the networks in the figure.
• Les subxarxes han de ser el més
Subnet 7 R1.s7 R1.s1 Subnet 1 R2.s1 R2.s4 Subnet 4 petites possible // Subnetworks have to
R1 R2
be as small as possible.
R1int
R1.s2 R2.s3
• Assigneu els blocs en ordre creixent
Subnet 6 (primer la subnet1, amb les adreces més
Internet baixes, després la 2, ...) i mirant de
Subnet 2 R3.s2
deixar el mínim espai possible entre
R3.s3 Subnet 3
R3 subnets.// Assign blocs in order (first
subnet1 with the lowest addresses, then
Subnet 5 2, ...), trying to leave the smallest space
possible between subnets.
a) Doneu adreces (IP/Mask) per a les següents interfícies dels routers, considerant que les subnets 1, 2 i 3 només
contenen els routers de la figura (no hi ha cap host addicional). // Assign addresses (IP/Mask) to the indicated
interfaces, considering that subnets 1, 2 and 3 have only routers (no extra hosts).
R1.s1 72.14.14.1/30
R2.s1 72.14.14.2/30
R3.s3 72.14.14.9/30

b) Indiqueu IP i màscara per a les subnets 4, 5, 6 i 7. La taula indica quants hosts ha de suportar cada subxarxa. //
Write IP and netmask for subnets 4, 5, 6, and 7. The number of supported host is indicated for each subnetwork.
Subnet ID # hosts IP/Màscara // IP/Netmask
Subnet 2 0 (només routers // only routers) 72.14.14.4/30
Subnet 4 40 72.14.14.64/26
Subnet 5 25 72.14.14.128/27
Subnet 6 20 72.14.14.160/27
Subnet 7 70 72.14.15.0/25
c) Si es vol assignar una nova subxarxa, indiqueu el bloc CIDR més gran que queda disponible (IP/Mask). // If a
new subnetworks has to be assigned, indicate the biggest available CIDR block (IP/Netmask).

d) Escriviu la taula de routing del router R2 (sense indicar cost) sabent que s’han creat considerant el mínim nombre
de salts, i que el router agrega rutes sempre que és possible. // Write the routing table of R2 (without cost) knowing
that it has been created considering the minimum number of hops, and that the router aggregates routes whenever
it is possible.

Destination Next hop Interface

72.14.14.0/30 DD R2.s1

72.14.14.8/30 DD R2.s3

72.14.14.64/26 DD R2.s4

72.14.14.128/26 72.14.14.9 R2.s3

0/0 72.14.14.1 R2.s1


EXERCICI 4 Nom / Name & NIU: _____________________________

Una aplicació que corre al host A de la xarxa x0 de la figura vol enviar un datagrama IP de 1000 bytes de
dades a un host amb nom de domini www.xarxes.com. El host amb nom de domini www.xarxes.com es troba
a la xarxa x1 i la seva adreça IP és 90.2.3.4. // An application running at A in network x0 wants to send an IP
datagram with 1000 bytes of data to the host www.xarxes.com. This last lost is in network x1 and its IP address
is 90.2.3.4.

Consideracions: (1) El host A per configurar-se ha fet servir el protocol DHCP i s’acaba de passar la meitat
del temps de cesió de la seva adreça IP. (2) Tots els hosts/routers de la xarxa X0 menys R0 tenen les seves
cache ARP buides. El router R0, en canvi, té a la seva cache ARP la informació necessària de resolució ARP
en tot moment. (3) El host DNS és el servidor DNS del host A. A més a més, el host DNS gestiona el domini
.com, no té cap adreça en la seva cache DNS i treballa de manera iterativa. (4) La taula d’encaminament del
router R1 té la següent entrada: 90.2.3.4/32 * m0 //

Considerations: (1) Host A used DHCP to configure IP, and half of the lease time has already passed. (2) All
hosts/routers in X0, except for R0, have empty ARP caches. R0, though, has all the ARP resolution information
in its ARP cache at all times. (3) DNS host is the DNS server of A. On top of this, DNS host manages the .com
domain, has no addresses in its DNS cache, and operates iteratively. (4) Routing table of R1 has the following
entry: 90.2.3.4/32 * m0

Ompliu la següent taula, fent servir el nombre de fileres necessàries, amb la descripció de les TRAMES
Ethernet que es veuran a la xarxa X0, respectant l’ordre en què es veuran. Feu les suposicions que considereu
oportunes. En la descripció de les dades, indiqueu les adreces dels protocols superiors, si n’hi ha. //
Fill in the table, using only the rows you need, with the description of the Ethernet FRAMES in network x0,
in the order they will be seen. Make the assumptions you may consider appropriate. In the data description,
indicate the upper protocol addresses, if there are any.

You might also like