Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
The way applications are developed today requires software engineers to have a firm understanding of client-server architecture and networking. If you’re planning to write web applications, or apps that communicate with a remote server, then networking is an essential skill. With this in mind, it’s clear that what you do as a software engineer will be deeply rooted in networking.
This course will teach you the fundamentals of networks, socket programming in Python, command-line tools and the main protocols of each layer. Additionally, you will get hands-on experience with not only socket programming, but with implementing network protocols that require distributed processing. Join us in a deep dive on everything network-related.
Q1. Tim Berners Lee invented the Internet
Q2. Tim Berners Lee invented the World Wide Web
Q3. What propelled the US into creating ARPA to research and develop new technology?
Q4. What is ARAPANET more commonly known as today?
Q5. A ______ is a set of rules that computers use to communicate with each other
Q6. The internet is a network of ______.
Q7. What is the difference between the internet and the world wide web?
Q1. Standardization enables ______
Q2. An RFC is _____.
Q1. Which of the following is a valid IP version 4 address?
Q2. Packets are ____
Q3. Hosts on the Internet are identified by _____.
Q4. Applications running on a host connected to the Internet are differentiated by _____.
Q1. Which of the following is NOT an end system?
Q2. What is the edge of the Internet?
Q1. What does ‘asymmetric transmission rate’ mean?
Q2. Routers and physical media such as wires that connect two end systems are part of an access network.
Q1. What’s a DSLAM?
Q1. Which access network utilizes telephony infrastructure on the last mile?
Q2. What kind of cable does the cable Internet access network use?
Q3. If you use cable Internet, you’ll have to get a separate connection for cable TV
Q4. What kind of connection is best for remote areas?
Q1. Why is fiber optic cable not as popular for commercial use as one would expect considering the advantages of high speed minimal loss transmission?
Q2. DSL and Dial-Up use the same physical media, twisted pair copper wire, then why do they have such different speeds?
Q1. Which of the following is not guided media?
Q2. Which of the following is not an advantage of radio waves as a medium?
Q1. A computer network that spans a large geographical area connecting several sites of an organization, such as a university or company, possibly across many countries is called a ______
Q2. LTE is a faster version of 3G
Q1. A disadvantage of the bus topology is that if the backbone wire is broken, the network may get negatively impacted
Q2. The tree topology is ___.
Q1. How many layers does the OSI model have?
Q2. What is layer-1 in the OSI Model?
Q3. What is layer-3 in the OSI model?
Q4. Layers interact with ___ ?
Q5. A user mostly interacts with ___ ?
Q1. The responsibilities of the presentation layer from the OSI model are handled by the ______ layer in the TCP/IP model.
Q2. The development of TCP/IP was funded by ______.
Q1. What architecture is the web based on?
Q2. Consider the following scenario, You run a salon that’s open at all times. You have customers that walk in, get services and leave.
If you had to categorize this scenario into one of the network application architectures, which one would it be?
Q3. Consider another scenario. Suppose you are a freelance artist with an account on a website such as Fiverr. The website regularly sends clients your way who want to purchase your artistic services. After the website connects you and the client, it leaves you to deal with them.
How would you categorize this scenario?
Q4. The application layer provides useful applications to the ______.
Q5. Which of the following is not an application layer service ______.
Q1. In a client-server model, the rate at which a client can download a file is limited by the ______.
Q2. A server uploads a file to some hosts in a P2P network. Now, the server goes offline. Will the file still be available for download?
Q1. A process is a running instance of a program
Q2. Web browsers such as Chrome on PCs have either port 80 if on HTTP and port 443 if on HTTPS reserved for themselves.
Q3. A socket is _____.
Q1. What does HTTP stand for?
Q2. In the context of HTTP, an object is a ____.
Q3. TCP stands for?
Q4. How is TCP different from UDP?
Q5. What transport layer protocol does HTTP use by default?
Q6. Persistent HTTP connections ____.
Q7. Non-persistent HTTP connections,
Q8. HTTP is a stateless protocol
Q1. What is HTTP?
Q2. What does the HTTP 200 OK response mean?
Q3. What does the HTTP 404 Not found response code mean?
Q4. Which of the following are the main features of HTTP?
Q5. Which of the following holds true about the following snippet of an HTTP response header?
HTTP/2.0 200 OK
date: Mon, 23 Sep 2019 06:04:43 GMT
content-type: text/plain
last-modified: Fri, 11 Jun 1999 18:46:53 GMT
Q1. What is cURL?
Q2. What does cURL stand for?
Q1. What is a cookie?
Q2. Which http header is used to set a cookie?
Q1. SMTP is a pull protocol
Q2. If an email fails to get sent, what happens?
Q1. Which of the following are valid differences between POP3 and IMAP?
Q1. Why is SMTP not used for transferring emails from the recipient’s mail server to the recipient’s user agent?
Q2. Suppose you are sending an email from your Gmail account to your friend via a web browser. Your friend reads their e-mail from their mail server using IMAP. Questions 2 and 3 are based on this scenario.
How does your email travel from your user agent to your friend’s email server agent?
Q3. Suppose you are sending an email from your Gmail account to your friend via a web browser. Your friend reads their e-mail from their mail server using IMAP. Questions 2 and 3 are based on this scenario.
How does your email then travel from your friend’s mail server to their inbox?
Q4. The ‘Subject’ line is compulsory
Q5. All SMTP e-mail messages are in 8-bit ASCII
Q6. ‘To’ and ‘From’ headers are NOT necessary
Q7. Suppose usera@example.com sends an email to userb@example.com where ‘example’ is a small company with one email server. How would the email travel in this scenario?
usera@example.com
‘s user agent to the example's
mail server via a push protocol like SMTP.userb@example.com
‘s user agent via a pull protocol like POP3 or IMAP. No inter-server communication happens.usera@example.com
‘s user agent to the example's
mail server via a push protocol like SMTP.userb@example.com
‘s mail server a pull protocol like POP2.userb@example.com
‘s inbox via HTTP.Q1. Which entity is contacted first when resolving a DNS name?
Q2. Which of the following best describes the purpose of using caching in DNS name resolution?
Q1. Which of the following are valid DNS record entry types?
Q2. Which of the following is an example of a top-level domain?
Q3. What does the Domain Name System do?
Q1. What category does BitTorrent fall in?
Q2. Content is downloaded directly from dedicated BitTorrent servers
Q1. The transport layer in the OSI reference model uses the services of ______ layer.
Q2. The transport layer typically provides connection oriented as well as connectionless end to end services to the application layer.
Q1. The transport layer in the TCP/IP reference model uses ______ to multiplex/demultiplex messages for different applications.
Q1. Ports 0 – 1023 are termed as ephemeral ports.
Q2. UDP receives application messages and establishes a connection with the receiver.
Q3. Applications send messages by writing data to a ______.
Q1. If the applications increase sending rate, the throughput ______ at first, then ______.
Q2. Typical response for applications to alleviate congestion in the network is to ______.
Q3. According to Kelinrock et al., the optimal transmission rate is one for which “power” is ______.
Q1. In the context of congestion control, an efficient rate allocation is desirable because ______.
Q2. An allocation that is fair but not efficient will cause congestion in the network
Q3. The optimal rate allocation lies at the intersection of the efficiency line and the ______.
Q1. Checksums address which imperfection of the network layer?
Q2. Sequence numbers address which imperfection of the network layer?
Q3. Retransmission timers address which imperfection of the network layer?
Q4. Suppose that we have a network layer that guarantees delivery of packets without bit errors. Does the transport layer still need to have checksums?
Q5. Suppose that we have a network layer that guarantees that there wouldn’t be any bit errors, but does not guarantee packet delivery. Do we still need to have retransmission at the transport layer?
Q1. Pipelining and congestion control are competing objectives
Q2. All sequence numbers in a sliding window are those that have not been transmitted yet.
Q1. A cumulative acknowledgement for sequence number n acknowledges the receipt of all sequences numbers upto and including ______.
Q2. A sliding window sender sends segments 0, 1, 2, 3, 4, and 5. It receives an acknowledgement for segment 2. That means that segments 3, 4, and 5 were dropped on their way before reaching the receiver.
Q3. A receiver receives segments 1021, 1022, 1024. It is time to send a cumulative ack. It will send an acknowledgement with sequence number ______.
Q4. Segments 1021, 1022, 1023, 1024 and 1025 are sent while a cumulative ack 1022 is received. A go-back-n sender will retransmit _______ .
Q5. Segments 1021, 1022, 1023, 1024 and 1025 are sent while acknowledgement is received for segments 1021, 1022, 1023 and 1024. A selective repeat sender will retransmit ______.
Q1. An application layer hands down 10 bytes to be sent in a UDP datagram. The value in the length field in the datagram will be ______.
Q2. The length field in a UDP datagram contains the value 0x0008. It contains ______ bytes of application data.
Q3. The first 8 bytes of a datagram are (in hexadecimal) AA AA 00 35 00 D3 A3 42. The datagram is destined for port number (decimal) ______.
Q4. The first 8 bytes of a datagram are (in hexadecimal) AA AA 00 35 00 D3 A3 42. The datagram comes from the port number (decimal) ______.
Q1. An application implements its own mechanisms of checksums and retransmissions. UDP is the ideal choice of transport layer protocol for this application.
Q2. An IoT application has infrequent short 4 byte messages to exchange between a sender and a receiver. Lost messages are not problematic, because messages contain cumulative values. Is UDP an ideal choice for this application?
Q3. A device needs to upload a large file to a server. Is UDP a good choice for this?
Q4. Checksum for a UDP datagram is being computed. The first 6 bytes are 01 01 01 01 00 08. The checksum for this datagram will be ______.
Q1. The fact that TCP is connection oriented guarantees in-order delivery of application messages/packets.
Q2. Which of the following best describes types of applications that would choose TCP over UDP?
Q3. Live audio conferencing is a prime example of an application that uses TCP.
Q4. On demand movie streaming is a good example of an application that can choose TCP over UDP.
Q1. Given an initial sequence number of 255 and 50 bytes sent in a TCP segment, what will be the value of the sequence number field in the next TCP packet header?
Q2. A web browser tab in Chrome has been assigned a port number of 2500. This tab is sending an HTTP message to a web server. The first four bytes of the TCP segment will be ______.
Q3. A TCP segment is sent with the value 2503 in the sequence number field and a payload of 50 bytes. The receiver sends back a segment containing the value __ in the acknowledge field.
Q4. An application sends a TCP segment with no options fields and 50 bytes of data. The length field in the segment will contain the value ______.
Q1. What functionality does the urgent flag allow that the push flag does not?
Q2. The TCP flags in a segment contain the binary value 0001. This segment is intended to ______.
Q3. The TCP flags in a segment contain the binary value 0010. This segment is intended to ______.
Q1. The window size represents the amount of buffer available at the receiver. This should be constant and only communicated in the first TCP segment sent from the receiver to the sender. What do you think?
Q2. How do you compare the checksum calculation mechanism in TCP with that in UDP?
Q1. A client is establishing a connection with a server. The first segment sent from the client to the server contains ______ in the flags field.
Q2. A client is establishing a connection with a server. The first segment sent from the server to the client in response to the SYN packet contains ______ in the flags field.
Q3. A client is establishing a connection with a server. In response to the SYN+ACK segment from the server, the client sends a segment that contains ______ in the flags field.
Q1. Simultaneous connection may result in more segments being exchanged than a regular three-way handshake.
Q2. Simultaneous connection results in an error that has to be resolved with a proper three-way handshake
Q1. A TCP connection establishment request may be refused due to which of the following reasons?
Q2. A ‘half-open’ connection refers to a connection where ______.
Q3. The retransmission timer is doubled upon every segment drop and it may reach infinite.
Q1. What are some reasons why a connection may get abruptly terminated?
Q2. Consider the following scenario:
Q3. Why does the connection wait for MSL seconds?
Q1. Consider the following scenario:
Will the data be buffered or sent on if Nagle’s was active?
Q2. Consider the following scenario:
Will the data be buffered or sent on if Nagle’s was active?
Q3. Consider the following scenario:
Will the data be buffered or sent on if Nagle’s was active?
Q1. Given the window scaling factor of 6 and window size of 3125, how many bytes can the sender send without waiting for an acknowledgement?
Q2. Given the window scaling factor of 7 and window size of 125, how many bytes can the sender send without waiting for an acknowledgement?
Q1. Which of the following is not a requirement of a congestion control algorithm?
Q2. What is the congestion window?
Q1. Slow start increases the congestion window size exponentially, whereas congestion avoidance increases the congestion window size linearly.
Q2. Given a congestion window of 10, what will the new value of the congestion window be after one RTT given that retransmission timer expires?
Q3. Given a congestion window of 10, what will the new value of the congestion window be after one RTT given that a fast retransmit occurs?
Q1. Why do we remove the host’s address from hosts
once a reply is received?
hosts
only has addresses of hosts that we are waiting for a reply from, so the address is removed as soon as one is receivedQ2. Which of the following is NOT TRUE about connect()
?
connect()
absolutely ensures that a reply from no server other than the one that we connected to is received!connect()
filters out messages from servers that we did not connect to based on their addressconnect()
makes it so that the address of the receiving server does not have to be specified at subsequent send()
and recv()
calls.Q1. What is the unit of information in the network layer called?
Q2. The network layer is dependent on the organization and structure of the underlying data link layer.
Q3. The network layer uses the services of the underlying transport layer
Q1. Which of the following is not a network layer principle?
Q2. Datagram organization is more common than virtual circuit organization?
Q3. Routing tables contain the exact geographic location of every end system on the internet
Q1. Given a network with 4 links with the following available bandwidth on each:
Which of the following is a possible value for C in the given equation to decide weights for each link?
weight = \frac{C}{bandwidth}weight=bandwidthC
Q2. Would static routing be appropriate for a large university campus network?
Q3. What’s the difference between a routing protocol and a routing algorithm?
Q1. What would the initial routing table look like at B for the following example with distance vector routing?
Destination | Count | Next Hop |
---|---|---|
A | 5 | A |
B | 3 | B |
D | 4 | D |
Destination | Count | Next Hop |
---|---|---|
A | 12 | A |
C | 3 | C |
E | 7 | E |
Destination | Count | Next Hop |
---|---|---|
A | 5 | A |
C | 3 | B |
E | 4 | D |
Answer:
from rip_packet import RIP_entry
from rip_packet import RIP_packet
from port import port
from port import port_link
class router_base:
def __init__(self, IP_address, rip_entries, ports):
self.IP_address = IP_address
self.rip_entries = rip_entries
self.ports = ports
def add_port(self, prt):
self.ports.append(prt)
def add_RIP_entry(self, port_IP, dest_IP, cost, next_hop_IP):
new_rip_entry = RIP_entry(port_IP, cost, dest_IP, next_hop_IP)
self.rip_entries.append(new_rip_entry)
def find_RIP_entry(self, destination_IP_to_find):
for entry in self.rip_entries:
if(entry.dest_IP_address == destination_IP_to_find):
return entry
return None
def set_RIP_entry_cost(self, destination_IP_to_find, new_cost):
for i in self.rip_entries:
if(entry.dest_IP_address == destination_IP_to_find):
entry.set_cost(new_cost)
return None
def delete_RIP_entry(self, destination_IP_to_find):
for entry in self.rip_entries:
if(entry.dest_IP_address == destination_IP_to_find):
self.rip_entries.remove(entry)
def print_router(self):
print("~~~~ Router IP address = " + str(self.IP_address) + "~~~~")
print("---Ports---")
print("Port IP | Destination Router IP | Destination Port IP | Cost")
for p in self.ports:
p.print_port()
print("---RIP entries---")
print("port IP | destination IP address | next hop | cost")
for re in self.rip_entries:
re.print_rip_entry()
def return_router(self):
r =[]
r.append("~~~~ Router IP address = " + str(self.IP_address) + "~~~~")
r.append("---Ports---")
r.append("Port IP | Destination Router IP | Destination Port IP | Cost")
for p in self.ports:
r.append(p.return_port())
r.append("---RIP entries---")
r.append("port IP | destination IP address | next hop | cost")
for re in self.rip_entries:
r.append(re.return_rip_entry())
return r
class router(router_base):
def send_RIP_packets(self, routers):
self.rip_packet = RIP_packet(self.rip_entries)
for i in range(len(routers)): # Find all neighbors and send then RIP packet
for j in range(len(self.ports)):
if routers[i].IP_address == self.ports[j].link.dest_IP_address:
routers = routers[i].receive_RIP_packets(self.rip_packet, self.ports[j].link, routers, self.IP_address)
return routers
def receive_RIP_packets(self, rip_packet, link_send_on, routers, next_hop_IP):
found = 0
new_rip_entries = []
for i in range(len(rip_packet.rip_entries)):
for j in range(len(self.rip_entries)):
if(rip_packet.rip_entries[i].dest_IP_address == self.rip_entries[j].dest_IP_address): # If entry exists
found = 1
new_cost = link_send_on.cost + rip_packet.rip_entries[i].cost
if(self.rip_entries[j].next_hop_IP == next_hop_IP and self.rip_entries[j].cost != new_cost): # If next hop is listed as the router received from
self.rip_entries[j].cost = min(16, new_cost)
break
elif(new_cost < self.rip_entries[j].cost):
self.rip_entries[j].cost = new_cost
self.rip_entries[j].next_hop_IP = next_hop_IP
break
# If entry does not already exist
if(not found):
new_rip_entries.append(RIP_entry(link_send_on.dest_port_IP, rip_packet.rip_entries[i].cost+link_send_on.cost, rip_packet.rip_entries[i].dest_IP_address, next_hop_IP))
found = 0
self.rip_entries.extend(new_rip_entries)
return routers
Q1. Why are routing loops uncommon in networks that use link state routing?
Q2. Which of the following is true about link state routing?
Q1. What is the aim of Dijkstra’s Algorithm?
Q2. Select the choice that most closely describes why the parent
list needed.
Q3. Suppose we want to find the most efficient path between a given source node and a given destination node. What can we do to optimize the algorithm in this case?
Answer:
def Dijkstra(graph, src, dst):
number_of_nodes = len(graph[0]) # Number of nodes in the graph
parent = [-1] * number_of_nodes # Setting up various lists
visited = []
unvisited = [i for i in range(number_of_nodes)]
distance = [16] * number_of_nodes # The distance list initially has a distance of infinite for all but the source node
distance[src] = 0
shortest_path = [] # This list will have the shortest path at the end
current = src # We start with the source
while(len(unvisited)>0):
# Visit all neighbors of current and update distance
for i in range(number_of_nodes):
if(graph[current][i]>=0 and distance[i] > graph[current][i]+distance[current]):
distance[i] = graph[current][i]+distance[current] # Update distance
parent[i] = current # Set new parent
if(current == dst):
break
unvisited.remove(current) # Move current node from unvisited to visted
visited.append(current)
if(len(unvisited) != 0):
current = unvisited[0] # New current node is an unvisited node with the smallest 'distance'
for n in unvisited:
if(distance[n] < distance[current]):
current = n
curr = dst # Some code to get the shortest path from 'parent'
shortest_path.append(curr)
cost = 0
while curr is not src:
if parent[curr] == -1: # If there is no path to the source node
return([[],-1])
cost = cost + graph[curr][parent[curr]] # The cost is the sum of the links in a path
curr = parent[curr]
shortest_path.append(curr)
shortest_path.reverse()
return([shortest_path, cost])
Q1. Suppose a new address class has a 4-bit subnet ID with one higher order bit out of the 4. How many addresses per network would that entail?
Q2. Every router has a direct route to every host on the internet in its routing table
Q1. What would the next hop for the IP address 205.135.3.2 be based on the following routing table?
Destination | Next-hop |
---|---|
205.135.0.0/16 | R3 |
205.135.3.0/24 | R1 |
205.0.0.0/8 | R2 |
Any other | R4 |
If entries for a certain IP address are not available (no prefix bits match), then they get forwarded to a certain default router.
Q2. Given the following subnets, how may they be summarized to a CIDR prefix with fewer bits for the network ID?
Q1. An Internet Protocol with the version number 15 is possible in theory.
Q1. Given the sample MTU size of 200 and an IP datagram of size 1999, how many fragments will be created?
Q2. Given that the MTU is 200200, what will be some field values for the first fragment of a packet with the following field values:
Q3. Given that the MTU is 200200, what will be some field values for the second fragment of a packet with the following field values:
Q4. Given field values for fragments received such as the following, what is the correct order of the fragments?
Fragment x:
Fragment y:
Q5. An application sends 2000 bytes, which are encapsulated in a minimum sized TCP header and then inside a minimal sized IP header. How big would the packet be?
Q6. An application sends 2000 bytes, which are encapsulated in a minimum sized UDP header and then inside a minimal sized IP header. How big would the packet be?
Q7. If an IP packet of size 3000 bytes is encapsulated inside Ethernet frames, how many frames will need to be sent?
Q8. A host sends an IP packet with a TTL of 8. There are 6 routers along the path. Will the packet be delivered to the destination or be dropped along the way?
Q9. A host sends an IP packet with a TTL of 8. There are 16 routers along the path. Will the packet be delivered to the destination or be dropped along the way?
Q1. An ICMP destination unreachable message is returned when ______.
Q2. An Fragmentation Needed message is returned when ______.
Q3. An Redirect message is returned when ______.
Q1. Suppose a host, A, sends an ARP request to a host C. Immediately after that, another host, D, wants to send a packet to host A. Will it send an ARP request assuming that there has not been any traffic on the LAN yet?
Q2. Based on the previous question, what if host D wants to send a packet to host C? Will host D send an ARP request assuming that there has not been any traffic on the LAN yet?
Q1. What are the responsibilities of the DHCP server?
Q2. Which of the following is NOT true about DHCP?
Q3. The source IP address of a DHCP response message is ______ and the destination IP address is ______.
Q1. When is an ICMP protocol unreachable message sent?
Q2. What happens if a router receives a packet with a TTL of 0?
Q3. What happens if the packet is larger than the MTU?
Q1. What’s a compact way of representing the IPv6 address: FE00:0:0:0:219:A34F:F3D7:1204?
Q2. An advantage of IPv6 is that its header is smaller than the IPv4 header.
Q3. IPv6 is NOT backwards compatible.
Q1. In an IPv6 unicast address, if 12 bits are used for the global routing prefix and 64 bits are used for the interface ID, how many are used for the subnet ID?
Q2. What is the IPv6 address ::1?
Q3. Which of the following is definitely NOT an IPv6 multicast address?
Q1. What is the purpose of firewalls?
Q2. A host-based firewall and antivirus program are the same thing
Q1. Suppose several end systems including a web server is behind a NAT. Will external clients be able to initiate connections with it?
Q2. Which of the following is a disadvantage of NAT?
Q3. One key advantage of NAT devices is that they help conserve the number of IPv4 addresses in use.
Q1. Why are domains needed?
Q2. Interdomain routing protocols allow the exchnage of routing information between _____.
Q3. Intradomain routing protocols allow the exchange of routing information between _____.
Q1. What would be the AS path to the prefix P10 in AS1?
Q2. What would be the AS path to the prefix P10 in AS2?
Q1. Hot potato routing always results in the overall least cost path being chosen.
Q2. Suppose you’re given the following topology and router wants to reach prefix x, accessible from R3. Which border router will it choose to access it?
Q1. What is the name of a data link layer message?
Q2. What is a key responsibility of the data link layer?
Q1. Consider that bit stuffing is used and the delimiting sequence is 01111110. The following bit pattern is received. Where does the frame start and where does it end?
1110011111100100010101000111111010
Q2. Following from the previous question, the sequence: 1110011111100100010101000111111010 is received in a bit stuffing situation with the delimiter 01111110. What sequence did the upper layer send?
Q3. In a character stuffing situation with the delimiters as described in the lesson, assume that the sequence 3 8 DLE STX 7 8 DLE DLE ETX DLE ETX was received. What part of the sequence is a complete frame? The frame is in bold in the answer choices.
Q4. If the sequence DLE STX 7 8 DLE DLE ETX DLE ETX was received in a character stuffing context, what would the upper layer have sent?
Q1. What would be the parity bit for the following string in an odd parity scheme?
100101001
Q2. What would be the parity bit for the following string in an even parity scheme?
100100001
Q3. Suppose the following string is received in an even parity scheme. The last bit is the parity bit. Was there an error in the string?
10101110
Q1. There is a fiber optic channel with a bandwidth of 30 MHz that needs to be equally shared amongst 30 users based on a static allocation scheme. The bandwidth allocated to each user will be ______.
Q2. 15 users are allocated transmission time slots of 10 ms each, on a shared TDM channel. Each user will get an opportunity to transmit after ______ ms.
Q1. Slotted ALOHA improves channel utilization
Q2. Which of the following is the most accurate and thorough description of the basic operation of ALOHAnet?
Q1. What’s the difference between persistent and non-persistent CSMA?
Q2. Does non-persistent CSMA provides higher channel utilization?
Q1. What would happen if a collision occurs and regular CSMA was deployed?
Q2. How does a sending host detect a collision?
Q3. How does a receiving host detect a collision?
Q1. Why is a minimum frame size necessary?
Q2. Which of the following best describes how removing acknowledgments has improved the data link layer?
Q1. Which of the following is NOT a valid unicast MAC address?
Q2. How many OUIs are available?
Q3. What does the following command do?
ifconfig ens4
Q1. What would be the total size of a minimal sized TCP packet encapsulated inside an IP packet, encapsulated inside an Ethernet frame?
Q2. What is the destination MAC address of the following Ethernet DIX frame?
011111001011111000100101011100000001110010110110 100111111100111110001110110010100111001100010111 0000100000000110
note: the payload and CRC are omitted!
7C:BE:25:70:1C:B6
38:2A:18:D7:C7:08
DD:CB:18:47:57:6E
Q3. What is the type of the following frame?
011111001011111000100101011100000001110010110110 100111111100111110001110110010100111001100010111 0000100000000110
note: the payload and CRC are omitted!
Q1. Which of the following is an advantage of 10BaseT?
Q2. Fast Ethernet is NOT compatible with slower Ethernet technologies
Q3. Which of the following most accurately describes the function of an Ethernet hub?
Q1. Consider the first network given in this lesson. Suppose host D joins it later than the rest and immediately sends a frame to host C. Will host A then be able to send it a frame right after?
Q2. Consider the first network given in this lesson. Suppose host D joins it later than the rest and immediately sends a frame to host E. Will host C then be able to send a frame to host D right after?
Answer:
# Paste into ports.py
class ports():
def __init__(self, mac_address, segment_number, port_type=1):
self.mac_address = mac_address # Numberic mac address
self.port_type = port_type # Blocking = 0, Forwarding = 1, root = 2
self.segment_number = segment_number
def get_reachable_bridge_ID(self, bridges_dict, calling_bridge_id):
bridge_id_list = []
for b in bridges_dict:
for p in bridges_dict[b].port_list:
if p.segment_number == self.segment_number and bridges_dict[b].bridge_ID != calling_bridge_id:
bridge_id_list.append(b)
return bridge_id_list
def get_port_state(self):
return self.port_type
def print_port(self):
print(str(self.mac_address) + " | ", end =" ")
if self.port_type == 0:
print("Blocking | ", end =" ")
elif self.port_type == 1:
print("Forwarding | ", end =" ")
elif self.port_type == 2:
print("Root | ", end =" ")
print(str(self.segment_number))
# Paste into bridge.py
from ports import ports
def is_better(BPDU1, BPDU2):
# If root is greater than BPDU1 is better
if(BPDU1[0] < BPDU2[0]):
return 1
elif(BPDU1[0] == BPDU2[0] and BPDU1[1] < BPDU2[1]):
return 1
elif(BPDU1[0] == BPDU2[0] and BPDU1[1] == BPDU2[1] and BPDU1[2] < BPDU2[2]):
return 1
elif(BPDU1[0] == BPDU2[0] and BPDU1[1] == BPDU2[1] and BPDU1[2] == BPDU2[2] and BPDU1[3] < BPDU2[3]):
return 1
else:
return 0
class bridge:
def __init__(self, bridge_ID, port_list):
self.bridge_ID = bridge_ID
self.port_list = port_list # port_list[0] is the port with port number 0
self.config_BPDU = [bridge_ID, 0, bridge_ID, None] # Root ID, Cost, Transmitting Bridge ID, Transmitting Mac Address
self.receive_queue = {}
def initialize_recv_queue(self, bridges_dict):
for b in bridges_dict:
self.receive_queue[b] = []
def set_bridge(self, bridge_ID, num_ports, mac_addresses):
self.bridge_ID = bridge_ID
self.num_ports = num_ports
self.port_list = port_list
def get_port(self, bridge_number, bridges_dict):
for i in range(len(self.port_list)):
if(bridge_number in self.port_list[i].get_reachable_bridge_ID(bridges_dict, self.bridge_ID)):
return i
def find_best_BPDUs_received(self, bridges_dict):
# Select best BPDU at each bridge
best_BPDUs_recvd = {} # Bridge Number : BPDU
best_bpdu = 0
for sending_brg_id in self.receive_queue:
if(len(self.receive_queue[sending_brg_id]) > 0):
best_bpdu = self.receive_queue[sending_brg_id][0]
for bpdu in self.receive_queue[sending_brg_id]:
if is_better(bpdu, best_bpdu):
best_bpdu = bpdu
best_BPDUs_recvd[sending_brg_id] = best_bpdu
self.initialize_recv_queue(bridges_dict)
return best_BPDUs_recvd
def update_ports(self, bridges_dict, best_BPDUs_recvd):
for sending_brg_id in best_BPDUs_recvd:
if sending_brg_id is not self.config_BPDU[0]:
if self.port_list[self.get_port(sending_brg_id, bridges_dict)].port_type != 2:
pn = self.get_port(sending_brg_id, bridges_dict)
if(is_better(best_BPDUs_recvd[sending_brg_id], self.get_config_BPDU_at_port(pn))):
self.port_list[self.get_port(sending_brg_id, bridges_dict)].port_type = 0
else:
self.port_list[self.get_port(sending_brg_id, bridges_dict)].port_type = 1
def elect_root(self, bridges_dict, best_BPDUs_recvd):
for sending_brg_id in best_BPDUs_recvd:
if(best_BPDUs_recvd[sending_brg_id][0] < self.config_BPDU[0]):
# New root bridge
self.config_BPDU[0] = best_BPDUs_recvd[sending_brg_id][0]
self.config_BPDU[1] = best_BPDUs_recvd[sending_brg_id][1] + 1
self.config_BPDU[2] = self.bridge_ID
self.config_BPDU[3] = self.get_port(sending_brg_id, bridges_dict)
if(self.get_root_port_id() is not None):
self.port_list[self.get_root_port_id()].port_type = 1
self.port_list[self.get_port(sending_brg_id, bridges_dict)].port_type = 2
def send_BPDUs(self, bridges_dict):
# Find all neighbors
for p in self.port_list:
if(p.get_port_state() > 0): # If sending port
# Send to all bridges on that segment
for b in p.get_reachable_bridge_ID(bridges_dict, self.bridge_ID):
pn = self.get_port(b, bridges_dict)
bridges_dict[b].receive_queue[self.bridge_ID].append(self.get_config_BPDU_at_port(pn))
return(bridges_dict)
def receive_BPDUs(self, bridges_dict):
# Update the bridge's state according to the best BPDUs received
# Find best BPDU received from each bridge
best_BPDUs_recvd = self.find_best_BPDUs_received(bridges_dict)
# Compare BPDUs with those received at non-root ports
self.update_ports(bridges_dict, best_BPDUs_recvd)
# Find root bridge
self.elect_root(bridges_dict, best_BPDUs_recvd)
# Update dictionary and return
bridges_dict[self.bridge_ID] = self
return bridges_dict
def get_root_port_id(self):
for p in range(len(self.port_list)):
if self.port_list[p].port_type == 2:
return p
return None
def get_config_BPDU_at_port(self, port_number):
BPDU_at_port = self.config_BPDU
BPDU_at_port[3] = self.port_list[port_number].mac_address
return(BPDU_at_port)
def print_bridge(self):
print("~~~~~~Bridge ID: " + str(self.bridge_ID) + " Root ID: " + str(self.config_BPDU[0]) + "~~~~~~" )
print("BPDU:")
print(self.config_BPDU)
print("MAC address | Port Type | Segment Number")
for port in self.port_list:
port.print_port()
Q1. Only ONE VLAN can be configured on one Ethernet switch
Q2. ONE VLAN can span over MULTIPLE switches
Q1. Which of the following is a valid socket address?
Q2. Which of the following has the fastest transmission rate?
Q3. Which of the following topology has a self-healing capability i.e., ability to re-route data using another path if one of the repeater nodes fails?
Q4. The encryption of data is done in the ____ layer of the OSI model?
Q5. If the server does not have a web page for the language specified in the HTTP header, then what will be the response from the server?
Q6. Consider the following HTTP request message:
GET /path/to/file/index.html HTTP/1.1
Host: www.educative.io
Connection: close
User-agent: Mozilla/5.0
Accept-language: fr
Accept: text/html
Which statement is the correct interpretation of the above request?
Q7. Electronic mail uses which Application layer protocol?
Q8. ____ address is used to uniquely identify an application/process running on a machine.
Q9. Which transport layer protocol is preferable for live video streaming?
Q10. Which of the following statement is not true?
Q11. If Alex is trying to send data to Bob, and Alex has received segments 41, 42, 44, and 45. Now Alex will send cumulative acknowledgment with sequence number ____?
Q12. Consider a scenario in which a packet of length 2,000 bytes, travels a distance of 1,500 km with a propagation speed of 2.5 * 10^8108 m/s, and transmission rate 2 Mbps. What will be the total propagation delay in this case?
Q13. Consider the following server-side code for a UDP socket:
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
port = 3000
hostname = '127.0.0.1'
print('Listening at {}'.format(s.getsockname()))
What will be the output of the program?
Q14. Which combination of socket family and type of socket is used to create a datagram socket?
Q15. Which one of the following methods puts the server in a blocking state in TCP socket programming until the client sends a connection request?
Q16. Which one of the following is a correct order of the functions to be called for a TCP client?
Q17. Which system call in socket programming results in the sending of SYN packets?
Q18. When a router receives a packet that is not destined to itself, it ____.
Q19. What would the initial routing table look like at C for the below network topology with distance vector routing?
Q20. What is the maximum number of IP addresses that can be assigned to hosts on a local subnet that uses the 255.255.255.224 subnet mask?
Q21. When calculating the usable hosts per subnet, the following formula is used (2bits – 2). For what reason is two subtracted?
Q22. If a packet has to travel from autonomous system A to autonomous system B, which routing protocol is preferable?
Q23. The ____ address is added by the data link layer to the frame.
Q24. Which of the following task is performed by the data link layer?
Q25. Match the protocol names given in the left column with the respective OSI protocol layer (on the right column) on which that protocol runs:
Q26. Match the layer name given in the left column with the respective name of the packet in that layer:
Q27. POP is a pull protocol.
Q28. Bind error happens if you use different port numbers for the client and server sides in TCP.
Q29. Devices configured over IPv4 can not access websites on servers configured with IPv6.
Q30. In CSMA/CD, the acknowledgment frames in the data link layer have been completely removed.
Q31. Explain the terms: Flow Control and Congestion Control. Name at least one protocol that uses these techniques?
Answer:
Q32. What are the techniques used by TCP that makes it reliable as compared to UDP?
Answer:
Q33. Explain the difference between an IP address and a prefix?
Answer:
I hope this Grokking Computer Networking for Software Engineers Educative Quiz Answers would be useful for you to learn something new from this problem. If it helped you then don’t forget to bookmark our site for more Coding Solutions.
This Problem is intended for audiences of all experiences who are interested in learning about Data Science in a business context; there are no prerequisites.
Keep Learning!
More Coding Solutions >>