Navraj Jhajj 40129282
COEN366 – ASSIGNMENT 1
a. 1- HTTP, it is used for fetching resources, this is what allows all data exchanges on the web and
relies on TCP to make sure the web pages are delivered correctly.
2-SMTP, it is used for mail servers and other messaging services to send and receive online
b.
messages (email). TCP is important because without it you could lose a small part of data and
corrupt the message.
3-DNS, it is made to read host names such as google.ca into ip addresses. UDP is important here
because the demands have small and fast response times, which means that if a packet is lost, the
client will just try again.
LINK: it is used for the transfer of data frames across physical link between two directly connected
nodes. It handles physical addressing, error detection at the local level.
TRANSPORT: it provides communication end-to-end (from beginning to end) between the source and
destination hosts. It ensures that data is provided as it needs to be (TCP or UDP) and end-to-end
ow control.
PRESENTATION: It makes sure that the data sent from one system can be received and applied by
the receiving application, its main tasks being encryption, compression and data syntax conversion.
Q2: It is necessary because in Layer 2 mentioned in the previous question the Link Layer is the data
transfer between two speci c nodes, also called hop-to-hop basis, ensuring that the sender does not
give too many requests to the directly connected neighbour. Then on the larger scale, layer 4 is the
Transport layer this layer needs ow control because it is what ensures that the data from the
beginning reaches the end destination meaning without ow control this could lead to error as the
nal receiving destination can get over owed and nothing would work.
Q3: If you ip 1 bit, b9 for example then p1 must ip to keep the math correct (it is odd and p1
sees that) and since p1 ips p3 must ip as well and so does p4. When you ip 2 bits in either p1
or p2 (example b6 and b5) the math cancels out and p1 sees no change thus no parity bits change
and we only change 2 bits. The resulting Hamming Distance is 2.
Q4:
Q5: REJ(N) is the negative acknowledgement, it will say if there is an error in speci c frame N, or
that it received frame N before Frame N-1 and it will then say to go back and retransmit the frame so
it is in the correct order.
RR(N) is the positive acknowledgement, it tells you that the receiver has received all frames up to N1, it also signals that it is ready to receive the next frame.
2^k (3bit) = 8 so 0 to 7
a. A: 0,1,2,3,4 B: 0,1,2,3,4
b. A: 3,4,5,6,7 -> because B sends RR1 and RR3, In go-back-n it makes it so B received
everything from 0 to 2, so the window for A moves up 3 spots.
c. A: 7,0,1,2,3 -> A send 4,5,6,7 and B acknowledges RR7 so it receives everything up to 6 and
then the new window starts at 7
d. A: 2,3,4,5,6 -> A send 0, 1 and B acknowledges RR2 so it receives 0 and 1 so it pushes the
window to 2
Q7:
1. Error 1: Station B starts with I,1,1 but N(s) should be 0 as it is B rst frame so I,0,1
2. Error 2: Station B ignores the REJ 1 from Station A and goes straight to RR3 when it still hasn’t
resubmitted N(S) = 1
3. Error 3: Can’t send RR2 after a disconnected link.