Grokking Computer Networking for Software Engineers Educative Quiz Answers

Get Grokking Computer Networking for Software Engineers Educative Quiz Answers

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.

Enroll on Educative

Quiz 1: A Quick History of The Internet

Q1. Tim Berners Lee invented the Internet

  • True
  • False

Q2. Tim Berners Lee invented the World Wide Web

  • True
  • False

Q3. What propelled the US into creating ARPA to research and develop new technology?

  • The advent of NASA
  • When the Soviets created the internet during the Cold War
  • The launch of Sputnik
  • The need for computers to communicate

Q4. What is ARAPANET more commonly known as today?

  • The World Wide Web
  • Google
  • Facebook
  • The Internet

Q5. A ______ is a set of rules that computers use to communicate with each other

  • Binary Code
  • Electrical signals on fibre optic cable
  • Wi-Fi signals
  • protocol
  • programming language

Q6. The internet is a network of ______.

  • People
  • Computers
  • Cables and Computers
  • Subnetworks that consist of computers that are connected to each other

Q7. What is the difference between the internet and the world wide web?

  • The Internet is a network of networks of computers whereas as the world wide web is information that can be accessed via the Internet.
  • The Internet is Google whereas as the world wide web is all the other websites like Facebook
  • The Internet is information that can be accessed via the world wide web wheres the world wide web is a network of networks of computers.

Quiz 2: Internet Standards Documents

Q1. Standardization enables ______

  • Interoperability
  • The best design practices to be followed
  • Optimization

Q2. An RFC is _____.

  • A committee that oversees standardization
  • Standardization proposal document

Quiz 3: Communication Over the Internet

Q1. Which of the following is a valid IP version 4 address?

  • 3.-1.33.67
  • 3456.3.17.8
  • a.e0.55.2
  • 203.128.22.10

Q2. Packets are ____

  • A unit of communication created based on application data segmented into manageable chunks
  • The physical entity (i.e. light and electricity) that communication happens through are also known as packets
  • The addresses of end systems

Q3. Hosts on the Internet are identified by _____.

  • IP addresses
  • Port numbers
  • Protocols

Q4. Applications running on a host connected to the Internet are differentiated by _____.

  • IP Addresses
  • Port numbers
  • Hardware of the machine they’re on

Quiz 4: The Edge of The Internet: End Systems

Q1. Which of the following is NOT an end system?

  • The mobile connection system
  • A digital door bell
  • A web server
  • A router

Q2. What is the edge of the Internet?

  • The mobile Internet of the likes of 3G
  • The end systems that connect to the Internet
  • The wires that allow connection to the Internet
  • Internet connection in edge places like rural areas and the country side

Quiz 5: What Are Access Networks?

Q1. What does ‘asymmetric transmission rate’ mean?

  • The speed of the Internet varies at different times of day
  • The speed of the Internet remains the same throughout the day
  • The upload speed and the download speed vary
  • The upload speed and the download speed are the same

Q2. Routers and physical media such as wires that connect two end systems are part of an access network.

  • True
  • False

Quiz 6: Types of Access Networks: DSL

Q1. What’s a DSLAM?

  • A device that creates DSL signals
  • A device that ISPs use to decode audio signals into digital signals
  • A device that end users use to encode audio signals into digital signals

Quiz 7: Types of Access Networks: Cable, FTTH, Dial-Up, and Satellite

Q1. Which access network utilizes telephony infrastructure on the last mile?

  • Dial-up
  • Fiber To The Home
  • DSL
  • Both A and C

Q2. What kind of cable does the cable Internet access network use?

  • Twisted cable
  • Spiral telephone cable
  • Coaxial Cable

Q3. If you use cable Internet, you’ll have to get a separate connection for cable TV

  • True
  • False

Q4. What kind of connection is best for remote areas?

  • Satellite
  • DSL
  • Dial-Up
  • Fiber Optic

Quiz 8: Types by Physical Medium: Guided Physical Media

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?

  • Fiber optic cable is expensive
  • Laying it down under the sea uses significant resources
  • Optical devices are very expensive
  • Coaxial cable and twisted pair copper wire work just as well for a fraction of the cost

Q2. DSL and Dial-Up use the same physical media, twisted pair copper wire, then why do they have such different speeds?

  • The ISP amplifies the speed of DSL at their central office whereas that does not happen with Dial-Up because it is cheaper
  • DSL uses a broader range of frequencies on the same cable while dialup only uses the voice range of frequencies
  • Dial-Up requires calling an operator to get a connection over a free wire which takes time
  • Dial-Up uses a slower modem for data transfer compared to DSL

Quiz 9: Types by Physical Medium: Unguided Physical Media

Q1. Which of the following is not guided media?

  • Coaxial cable
  • Ethernet cable
  • Radio waves
  • Fiber Optic cable

Q2. Which of the following is not an advantage of radio waves as a medium?

  • They can penetrate through physical barriers like walls
  • They allow end systems to become mobile
  • They’re more secure

Quiz 10: Types by Geographical Distance

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 ______

  • LAN
  • WAN
  • MAN
  • WLAN

Q2. LTE is a faster version of 3G

  • True
  • False

Quiz 11: Types by Topology

Q1. A disadvantage of the bus topology is that if the backbone wire is broken, the network may get negatively impacted

  • True
  • False

Q2. The tree topology is ___.

  • a network of several busses connected together like a star
  • where the wires physically resemble a tree
  • a network of star topology networks connected together in a bus

Quiz 12: The Open Systems Interconnection (OSI) Model

Q1. How many layers does the OSI model have?

  • six
  • eight
  • nine
  • seven
  • four

Q2. What is layer-1 in the OSI Model?

  • Application
  • Physical
  • Network
  • Data Link

Q3. What is layer-3 in the OSI model?

  • Application
  • Transport
  • Session
  • Network

Q4. Layers interact with ___ ?

  • All the other layers
  • Only adjacent layers
  • The layer on top
  • The layer below

Q5. A user mostly interacts with ___ ?

  • The application layer
  • The physical layer
  • The transport layer
  • The network layer

Quiz 13: The TCP/IP Model

Q1. The responsibilities of the presentation layer from the OSI model are handled by the ______ layer in the TCP/IP model.

  • Network
  • Transport
  • Application
  • Data Link

Q2. The development of TCP/IP was funded by ______.

  • Microsoft
  • IBM
  • DARPA
  • Google

Quiz 14: Network Application Architectures

Q1. What architecture is the web based on?

  • P2P
  • Client-Server
  • Distributed
  • Hybrid

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?

  • P2P
  • Hybrid
  • Client-server

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?

  • P2P
  • Hybrid
  • Client-server

Q4. The application layer provides useful applications to the ______.

  • end user
  • Internet router
  • data link layer

Q5. Which of the following is not an application layer service ______.

  • Email
  • Web browsing
  • Flow control

Quiz 15: P2P vs. Client-Server

Q1. In a client-server model, the rate at which a client can download a file is limited by the ______.

  • server upload rate
  • client download rate
  • min( a , b )

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?

  • Yes
  • No

Quiz 16: How Processes Communicate

Q1. A process is a running instance of a program

  • True
  • False

Q2. Web browsers such as Chrome on PCs have either port 80 if on HTTP and port 443 if on HTTPS reserved for themselves.

  • True
  • False

Q3. A socket is _____.

  • a physical connector at the back of the computer
  • a combination of the IP address and a port number
  • None of the above

Quiz 17: HTTP: The Basics

Q1. What does HTTP stand for?

  • HyperText Transmission Protocol
  • HyperTime Transmission Plan
  • HyperText Transfer Protocol
  • HandleTransmission Transfer Plan

Q2. In the context of HTTP, an object is a ____.

  • Instance of a class
  • A file
  • A pointer to an instance of a class

Q3. TCP stands for?

  • Transmission Congestion Protocol
  • Text Conveyance Protocol
  • Transmission Control Plan
  • Transmission Control Protocol

Q4. How is TCP different from UDP?

  • TCP does not ensure delivery of messages
  • UDP ensures messages get delivered in order and correctly
  • UDP ensures that all messages do get delivered by default
  • TCP ensures that all messages do get delivered correctly and in order.

Q5. What transport layer protocol does HTTP use by default?

  • TCP
  • UDP

Q6. Persistent HTTP connections ____.

  • Use one TCP connection to serve all requests
  • Use one UDP connection to serve all requests
  • Use one TCP connection to serve one request
  • Use one UDP connection to serve one request

Q7. Non-persistent HTTP connections,

  • Use one TCP connection to serve all requests
  • Use one UDP connection to serve all requests
  • Use one TCP connection to serve one request
  • Use one UDP connection to serve one request

Q8. HTTP is a stateless protocol

  • True
  • False

Quiz 18: HTTP: Response Messages

Q1. What is HTTP?

  • HTTP stands for Hypertext Transfer Protocol. It’s a set of rules for transferring of data on the web.
  • A language in which websites are written.
  • The world wide web is HTTP
  • The starting of URLs

Q2. What does the HTTP 200 OK response mean?

  • The file is okay
  • The file was 200 bytes long
  • The request is successful
  • HTTP is up and running

Q3. What does the HTTP 404 Not found response code mean?

  • The file requested has been shifted to another domain
  • The requested object is not available at the web server.
  • The object is 404 bytes long
  • The HTTP version is not compatible

Q4. Which of the following are the main features of HTTP?

  • HTTP is a response protocol.
    HTTP is a stateless protocol.
  • HTTP is a request and response protocol.
    HTTP is a stateless protocol.
  • HTTP is a request protocol.
    HTTP is a stateful protocol.
  • HTTP is a request and response protocol.
    HTTP is a stateful protocol by default.

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
  • The document was accessed on June 11th, 1999
  • The requested object is a video
  • The document is a plain text type requested on Monday, September 23rd, 2019.

Quiz 19: Exercise: Looking at a Real HTTP Response

Q1. What is cURL?

  • A tool that diverts http responses by making them ‘curl’
  • A command line tool that copies URLs
  • A command line tool for transferring data based on various protocols

Q2. What does cURL stand for?

  • Client URL
  • Caustic URL
  • Communication URL
  • Command-line URL

Quiz 20: Cookies

Q1. What is a cookie?

  • An identifier that’s stored in client browsers. It’s used by websites to serve customized content.
  • An http header
  • Only a way to track people across websites
  • They are http headers that make http stateless

Q2. Which http header is used to set a cookie?

  • setcookie
  • SetCookie
  • Set-cookie

Quiz 21: Email: SMTP

Q1. SMTP is a pull protocol

  • True
  • False

Q2. If an email fails to get sent, what happens?

  • The recipient gets a mail not delivered error
  • The sender gets a mail not delivered error
  • The recipient sends a mail not delivered error
  • The sender sends a mail not delivered error

Quiz 22: Email: POP & IMAP

Q1. Which of the following are valid differences between POP3 and IMAP?

  • POP3 is less accurate
    IMAP is more accurate
  • POP3 does not sync folders whereas IMAP does
    POP3 might make for different email structures on different devices
    POP3 deletes emails on servers by default but IMAP does not
  • POP3 works more accurately
    IMAP is better
  • POP3 syncs all folders
    IMAP does not sync folders across clients

Quiz 23: Email: Message Format

Q1. Why is SMTP not used for transferring emails from the recipient’s mail server to the recipient’s user agent?

  • SMTP is a push protocol whereas the task of transferring email messages from the recipient’s mail server to the recipient’s personal computer is a pull operation.
  • SMTP is a pull protocol, whereas the task of transferring email messages from the recipient’s mail server to the recipient’s personal computer is a push operation
  • SMTP is a push protocol whereas the task of transferring email messages to the recipient’s mail server from the recipient’s personal computer is a pull operation.
  • SMTP is a pull protocol whereas the task of transferring email messages to the recipient’s mail server from the recipient’s personal computer is a push operation.

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?

  • The email is sent from your user agent to your mail server over SMTP. Your mail server then sends the message to your friend’s mail server over SMTP.
  • The email is sent from your user agent to your mail server, your mail server then sends the message to you. The message then gets transferred from you to your friend’s computer directly.
  • The email is sent from your user agent to your friend directly.

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?

  • The message gets transferred from your friend’s mail server to their user agent inbox over SMTP.
  • The message gets transferred from your friend’s mail server to their user agent inbox over IMAP.
  • The message gets transferred from your friend’s mail server to their user agent inbox over HTTP.

Q4. The ‘Subject’ line is compulsory

  • True
  • False

Q5. All SMTP e-mail messages are in 8-bit ASCII

  • True
  • False

Q6. ‘To’ and ‘From’ headers are NOT necessary

  • True
  • False

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?

  • The email travels from usera@example.com‘s user agent to the example's mail server via a push protocol like SMTP.
    The email is then downloaded from the company mail server to 
    userb@example.com‘s user agent via a pull protocol like POP3 or IMAP. No inter-server communication happens.
  • The email travels from usera@example.com‘s user agent to the example's mail server via a push protocol like SMTP.
    The email is then pulled from the company mail server to userb@example.com‘s mail server a pull protocol like POP2.
    The email is finally downloaded to userb@example.com‘s inbox via HTTP.
  • This scenario is impossible. Email does not work with just one server.

Quiz 24: DNS: Introduction

Q1. Which entity is contacted first when resolving a DNS name?

  • local resolver library
  • root server
  • local DNS server
  • .com server

Q2. Which of the following best describes the purpose of using caching in DNS name resolution?

  • Reducing load on the authoritative server
  • Reducing latency of name resolution
  • A and B
  • None of the above

Quiz 25: DNS: Records and Messages

Q1. Which of the following are valid DNS record entry types?

  • A
  • M
  • CNAME
  • A and C
  • A and B

Q2. Which of the following is an example of a top-level domain?

  • .com
  • google.com
  • scholar.google.com

Q3. What does the Domain Name System do?

  • It allows users to use a URL and to lookup an IP address
  • It is used to keep track of all the GPS coordinates of all servers
  • It assigns different IP addresses to computers as they move from one WiFI end point to another

Quiz 26: BitTorrent

Q1. What category does BitTorrent fall in?

  • Client/Server
  • Hybrid
  • Peer-to-peer

Q2. Content is downloaded directly from dedicated BitTorrent servers

  • True
  • False

Quiz 27: What Is the Transport Layer?

Q1. The transport layer in the OSI reference model uses the services of ______ layer.

  • Data link
  • Session
  • Network

Q2. The transport layer typically provides connection oriented as well as connectionless end to end services to the application layer.

  • True
  • False

Quiz 28: Multiplexing and Demultiplexing

Q1. The transport layer in the TCP/IP reference model uses ______ to multiplex/demultiplex messages for different applications.

  • IP address
  • Port number
  • Application names

Quiz 29: Multiplexing & Demultiplexing in UDP

Q1. Ports 0 – 1023 are termed as ephemeral ports.

  • True
  • False

Q2. UDP receives application messages and establishes a connection with the receiver.

  • True
  • False

Q3. Applications send messages by writing data to a ______.

  • Port
  • Socket
  • Datagram

Quiz 30: Introduction to Congestion Control

Q1. If the applications increase sending rate, the throughput ______ at first, then ______.

  • increases, keeps increasing
  • increases, drops
  • drops, increases
  • decreases, keeps decreasing

Q2. Typical response for applications to alleviate congestion in the network is to ______.

  • increase their sending rate
  • keep sending at the same rate
  • decrease their sending rate
  • start sending at a random sending rate

Q3. According to Kelinrock et al., the optimal transmission rate is one for which “power” is ______.

  • constant
  • random
  • minimum
  • maximum

Quiz 31: More on Principles of Congestion Control

Q1. In the context of congestion control, an efficient rate allocation is desirable because ______.

  • Regulators mandate it
  • It uses network resources efficiently
  • It’s also fair

Q2. An allocation that is fair but not efficient will cause congestion in the network

  • True
  • False

Q3. The optimal rate allocation lies at the intersection of the efficiency line and the ______.

  • x-axis
  • the fairness line
  • y-axis

Quiz 32: Principles of Reliable Data Transfer

Q1. Checksums address which imperfection of the network layer?

  • Packet drops
  • Packet errors
  • Packet reordering

Q2. Sequence numbers address which imperfection of the network layer?

  • Packet drops
  • Packet errors
  • Packet reordering
  • A and C
  • None of the above

Q3. Retransmission timers address which imperfection of the network layer?

  • Packet drops
  • Packet errors
  • Packet reordering

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?

  • Yes
  • No

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?

  • Yes
  • No

Quiz 33: Reliable Data Transfer: Sliding Window

Q1. Pipelining and congestion control are competing objectives

  • True
  • False

Q2. All sequence numbers in a sliding window are those that have not been transmitted yet.

  • True
  • False

Quiz 34: Reliable Data Transfer: Go-back-n

Q1. A cumulative acknowledgement for sequence number n acknowledges the receipt of all sequences numbers upto and including ______.

  • n−1
  • n

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.

  • True
  • False

Q3. A receiver receives segments 1021, 1022, 1024. It is time to send a cumulative ack. It will send an acknowledgement with sequence number ______.

  • 1021
  • 1022
  • 1023
  • 1024

Q4. Segments 1021, 1022, 1023, 1024 and 1025 are sent while a cumulative ack 1022 is received. A go-back-n sender will retransmit _______ .

  • segment 1023
  • segment 1024
  • segment 1025
  • all of the above

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 ______.

  • segment 1023
  • segment 1024
  • segment 1025
  • all of the above

Quiz 35: The User Datagram Protocol

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 ______.

  • 0x000A
  • 0x0012
  • 0x0018
  • None of the above

Q2. The length field in a UDP datagram contains the value 0x0008. It contains ______ bytes of application data.

  • 8 bytes
  • 0 bytes
  • 16 bytes
  • None of the above

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) ______.

  • 43690
  • 53
  • 211
  • 41794

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) ______.

  • 43690
  • 53
  • 211
  • 41794

Quiz 36: UDP Checksum Calculation & Why UDP?

Q1. An application implements its own mechanisms of checksums and retransmissions. UDP is the ideal choice of transport layer protocol for this application.

  • True
  • False

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?

  • Yes
  • No

Q3. A device needs to upload a large file to a server. Is UDP a good choice for this?

  • Yes
  • No

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 ______.

  • There isn’t enough information to answer this question
  • 02 0A
  • FD F5
  • 00 08

Quiz 37: The Transmission Control Protocol

Q1. The fact that TCP is connection oriented guarantees in-order delivery of application messages/packets.

  • True
  • False

Q2. Which of the following best describes types of applications that would choose TCP over UDP?

  • require in-order delivery
  • require guaranteed delivery
  • require correct message delivery
  • all of the above

Q3. Live audio conferencing is a prime example of an application that uses TCP.

  • True
  • False

Q4. On demand movie streaming is a good example of an application that can choose TCP over UDP.

  • True
  • False

Quiz 38: TCP Segment Header

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?

  • The sequence number of the last byte in the previous segment i.e., 254
  • The number of bytes in the first segment, i.e., 50
  • The sequence number of the next expected byte to be sent i.e., 255
  • The sequence number of the next expected byte to be sent i.e., 305

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 ______.

  • 09 C4 00 50
  • 00 50 09 C4
  • 09 C4 09 C4
  • 00 50 00 50

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.

  • 2503
  • 2553
  • 2554
  • None of the above

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 ______.

  • 18
  • 5
  • 13
  • None of the above

Quiz 39: TCP Header Flags

Q1. What functionality does the urgent flag allow that the push flag does not?

  • URG is more important and has higher priority
  • URG marks out which part of the data is urgent
  • PSH pushes out data immediately while URG ensures that it’s sent up to the application immediately only

Q2. The TCP flags in a segment contain the binary value 0001. This segment is intended to ______.

  • establish a TCP connection
  • keep the connection alive
  • tear down a TCP connection

Q3. The TCP flags in a segment contain the binary value 0010. This segment is intended to ______.

  • establish a TCP connection
  • keep the connection alive
  • tear down a TCP connection

Quiz 40: TCP Headers: Window Size, Checksum & More

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?

  • That is an excellent idea
  • The amount of buffer dynamically changes, so this field is needed
  • This must be due to some politics during TCP standardization

Q2. How do you compare the checksum calculation mechanism in TCP with that in UDP?

  • They are identical
  • Checksums are mandatory in UDP, optional in TCP
  • Checksums are mandatory in TCP, optional in UDP
  • The calculation is different.

Quiz 41: TCP Connection Establishment: Three-way Handshake

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.

  • 00 01 00 10
  • 00 00 00 10
  • 00 01 00 00

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.

  • 00 01 00 10
  • 00 00 00 10
  • 00 01 00 00

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.

  • 00 01 00 10
  • 00 00 00 10
  • 00 01 00 00

Quiz 42: Other TCP Connection Establishment Methods

Q1. Simultaneous connection may result in more segments being exchanged than a regular three-way handshake.

  • True
  • False

Q2. Simultaneous connection results in an error that has to be resolved with a proper three-way handshake

  • True
  • False

Quiz 43: When Connection Establishment Fails: Syn Floods & Retransmission

Q1. A TCP connection establishment request may be refused due to which of the following reasons?

  • The server already has one other open connection and hence cannot deal with another.
  • The server does not have enough resources to open another connection.
  • The server has one other half-open connection.

Q2. A ‘half-open’ connection refers to a connection where ______.

  • The client has sent a SYN segment and has received a SYN+ACK segment in response
  • The server has received a SYN and the client is waiting on a SYN+ACK
  • The client has received the last ACK from the server and is waiting for data in response to a request it has made

Q3. The retransmission timer is doubled upon every segment drop and it may reach infinite.

  • True
  • False

Quiz 44: TCP Connection Release

Q1. What are some reasons why a connection may get abruptly terminated?

  • The server has sent all the data that was requested
  • The server does not have enough resources to sustain the connection
  • The client has received all the data that it needed and the connection is now redundant

Q2. Consider the following scenario:

  1. A server sends a FIN segment to a client on an established connection
  2. The client responds with an ACK
  • The server can still send data to the client
  • Both the client and the server can send data to each other
  • The client can send data to the server

Q3. Why does the connection wait for MSL seconds?

  • If the connection does not wait, a duplicate segment (including a duplicated ACK) may be received and the connection may go through an abrupt release.
  • To ensure that both parties delete the TCB before the connection is fully terminated
  • To allow for the finish garbage collection before terminating the connection fully

Quiz 45: Efficient data transmission with TCP

Q1. Consider the following scenario:

  1. The last segment received by a TCP entity had an ACK value of 10.
  2. The MSS value is 536.
  3. There are 50 bytes in the buffer waiting for transmission.
  4. The window size is 500.
  5. The application sends a 500 byte message.
  6. All the data sent so far has been acknowledged.

Will the data be buffered or sent on if Nagle’s was active?

  • It will be buffered
  • One TCP segment with all the buffered data will be sent
  • One MSS sized segment will be sent

Q2. Consider the following scenario:

  1. The last segment received by a TCP entity had an ACK value of 10.
  2. The MSS value is 536.
  3. There are 50 bytes in the buffer waiting for transmission.
  4. The window size is 500.
  5. The application sends a 500 byte message.
  6. Some of the data sent so far has NOT been acknowledged.

Will the data be buffered or sent on if Nagle’s was active?

  • It will be buffered
  • One TCP segment with all the buffered data will be sent
  • One MSS sized segment will be sent

Q3. Consider the following scenario:

  • The last segment received by a TCP entity had an ACK value of 10.
  • The MSS value is 536.
  • There are 40 bytes in the buffer waiting for transmission.
  • The window size is 620.
  • The application sends a 500 byte message.
  • All of the data sent so far has been acknowledged.

Will the data be buffered or sent on if Nagle’s was active?

  • It will be buffered
  • One TCP segment with all the buffered data will be sent
  • One MSS sized segment will be sent

Quiz 46: TCP Window Scaling

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?

  • 100000
  • 200000
  • 2000000

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?

  • 1500
  • 160000
  • 16000

Quiz 47: TCP Congestion Control: AIMD

Q1. Which of the following is not a requirement of a congestion control algorithm?

  • Must avoid congestion
  • Must be fair
  • Must be efficient
  • Must be accurate

Q2. What is the congestion window?

  • The number of unacknowledged data in bytes the sender can send in total
  • The number of bytes the sender can send
  • It is the same as the receiving window

Quiz 48: TCP Congestion Control: Slow Start

Q1. Slow start increases the congestion window size exponentially, whereas congestion avoidance increases the congestion window size linearly.

  • True
  • False

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?

  • Half of the original size, i.e., 5
  • Twice the original size, i.e., 10
  • 1
  • The size of the slow-start threshold which is not given

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?

  • Half of the original size, i.e., 5
  • Twice the original size, i.e., 10
  • 1
  • The size of the slow-start threshold which is not given

Quiz 49: Improvements to UDP Programs: Avoiding Arbitrary Servers

Q1. Why do we remove the host’s address from hosts once a reply is received?

  • To evade attacks from arbitrary servers
  • hosts only has addresses of hosts that we are waiting for a reply from, so the address is removed as soon as one is received
  • To ensure that the replies are received in an orderly fashion

Q2. 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 address
  • Using connect() makes it so that the address of the receiving server does not have to be specified at subsequent send() and recv() calls.

Quiz 50: What Is the Network Layer?

Q1. What is the unit of information in the network layer called?

  • A segment
  • A datagram
  • A packet

Q2. The network layer is dependent on the organization and structure of the underlying data link layer.

  • True
  • False

Q3. The network layer uses the services of the underlying transport layer

  • True
  • False

Quiz 51: Organization of the Network layer

Q1. Which of the following is not a network layer principle?

  • The network layer is designed to work with specific flavors of the data link layer.
  • Each network layer entity is identified by a network layer address. This address is independent of the data link layer addresses that the entity may use.
  • The service provided by the network layer does not depend on the service or the internal organization of the underlying data link layers.
  • The network layer is conceptually divided into two planes.

Q2. Datagram organization is more common than virtual circuit organization?

  • True
  • False

Q3. Routing tables contain the exact geographic location of every end system on the internet

  • True
  • False

Quiz 52: The Control Plane: Static & Dynamic Routing

Q1. Given a network with 4 links with the following available bandwidth on each:

  1. 100
  2. 300
  3. 40
  4. 10

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

  • 10
  • 40
  • 300
  • 301

Q2. Would static routing be appropriate for a large university campus network?

  • Yes
  • No

Q3. What’s the difference between a routing protocol and a routing algorithm?

  • A routing protocol is applied only to routers whereas algorithms can work on all sorts of machines and can be coded
  • Protocols are designs proposed in RFCs and algorithms are software implementations of those designs
  • Routing protocols are software or hardware implementations of algorithms

Quiz 53: The Control Plane: Distance Vector – Routing Information Protocol

Q1. What would the initial routing table look like at B for the following example with distance vector routing?

  • Option 1
Destination Count Next Hop
A5A
B3B
D4D
  • Option 2
Destination Count  Next Hop
A12A
C3C
E7E
  • Option 3
Destination Count  Next Hop
A5A
C3B
E4D

Programming Challenge 1: Routing Information Protocol

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      
      

Quiz 54: The Control Plane: Link State Routing

Q1. Why are routing loops uncommon in networks that use link state routing?

  • Each router builds a partial view of the network based on number of nodes
  • Routers flood the network and use LSAs to discover any loops.
  • Each router builds a comprehensive and updated view of the network.

Q2. Which of the following is true about link state routing?

  • All routers have a partial view of the network topology
  • All routers maintain a database of the LSPs from all other routers
  • All routers are connected to every other router directly

Quiz 55: The Control Plane: Route Calculation – Dijkstra’s

Q1. What is the aim of Dijkstra’s Algorithm?

  • To find the shortest paths from every node to every other node in a given graph
  • To find the most efficient paths from every node to every other node in a given graph
  • To find the most efficient paths from a node in a given graph to every other node in the graph

Q2. Select the choice that most closely describes why the parent list needed.

  • To figure out the most efficient paths from the starting source node to any destination in the graph
  • To figure out the most efficient paths from any node to the source node in the graph

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?

  • Only include the given destination node in the unvisited set
  • As soon as the given destination node is encountered, exit the algorithm as we now have all the information needed to calculate the most efficient path between the given source node and the given destination node.
  • As soon as the given destination node is added to the visited set, exit the algorithm as we now have all the information needed to calculate the most efficient path between the given source node and the given destination node

Programming Challenge 2: Implementing Dijkstra’s

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])

Quiz 56: The Internet Protocol: Introduction to IPV4

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?

  • 2^4 = 16
  • 24−1=23=8
  • 28=256
  • 232−4=228=268,435,456

Q2. Every router has a direct route to every host on the internet in its routing table

  • True
  • False

Quiz 57: The Internet Protocol: IPV4 Address Allocation

Q1. What would the next hop for the IP address 205.135.3.2 be based on the following routing table?

DestinationNext-hop
205.135.0.0/16R3
205.135.3.0/24R1
205.0.0.0/8R2
Any otherR4

If entries for a certain IP address are not available (no prefix bits match), then they get forwarded to a certain default router.

  • R1
  • R2
  • R3
  • R4

Q2. Given the following subnets, how may they be summarized to a CIDR prefix with fewer bits for the network ID?

  1. 192.168.1.0/24
  2. 192.168.2.0/24
  3. 192.168.3.0/24
  4. 192.168.4.0/24
  • 192.168.0.0/26
  • 192.167.0.0/22
  • 192.168.0.0/21

Quiz 58: The Internet Protocol: IPV4 Packets

Q1. An Internet Protocol with the version number 15 is possible in theory.

  • True
  • False

Quiz 59: The Internet Protocol: IPV4 Packet Fragmentation & Reassembly

Q1. Given the sample MTU size of 200 and an IP datagram of size 1999, how many fragments will be created?

  • 10
  • 1 because fragmentation will not be needed
  • 9 since the rest of the data will be discarded

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:

  1. Length: 1999 bytes
  2. Identification: 2034
  3. The flags
    • More fragments: 0
    • Don’t Fragment (DF): 0
  4. Fragment Offset: 0
  • First fragment:
  1. Length: 2000 bytes
  2. Identification: 2034
  3. The flags
    • More fragments: 1
    • Don’t Fragment (DF): 0
  4. Fragment Offset: 0
  • First fragment:
  1. Length: 200 bytes
  2. Identification: 2034
  3. The flags
    • More fragments: 1
    • Don’t Fragment (DF): 1
  4. Fragment Offset: 0
  • First fragment:
  1. Length: 1999 bytes
  2. Identification: 2034
  3. The flags
    • More fragments: 1
    • Don’t Fragment (DF): 1
  4. Fragment Offset: 0

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:

  1. Length: 1999 bytes
  2. Identification: 2034
  3. The flags
    • More fragments: 0
    • Don’t Fragment (DF): 0
  4. Fragment Offset: 0
  • Second fragment:
  1. Length: 200 bytes
  2. Identification: 2034
  3. The flags
    • More fragments: 1
    • Don’t Fragment (DF): 1
  4. Fragment Offset: 25
  • Second fragment:
  1. Length: 200 bytes
  2. Identification: 2034
  3. The flags
    • More fragments: 1
    • Don’t Fragment (DF): 2
  4. Fragment Offset: 25
  • Second fragment:
  1. Length: 200 bytes
  2. Identification: 2035
  3. The flags
    • More fragments: 1
    • Don’t Fragment (DF): 1
  4. Fragment Offset: 25

Q4. Given field values for fragments received such as the following, what is the correct order of the fragments?

Fragment x:

  1. Length: 200 bytes
  2. Identification: 2034
  3. The flags
    • More fragments: 1
    • Don’t Fragment (DF): 1
  4. Fragment Offset: 25

Fragment y:

  1. Length: 200 bytes
  2. Identification: 2034
  3. The flags
    • More fragments: 1
    • Don’t Fragment (DF): 1
  4. Fragment Offset: 0
  • Fragment x comes first, then fragment y
  • Fragment y comes first, then fragment x
  • The order does not matter

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?

  • 2000 bytes
  • 2400 bytes
  • 2040 bytes
  • 2028 bytes

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?

  • 2000 bytes
  • 2400 bytes
  • 2040 bytes
  • 2028 bytes

Q7. If an IP packet of size 3000 bytes is encapsulated inside Ethernet frames, how many frames will need to be sent?

  • 1
  • 2
  • 3

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?

  • It will be dropped because there aren’t enough routers in the way to cater for the TTL
  • it will be delivered unless there is a routing loop
  • It will be delivered with a 100% guarantee

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?

  • It will be dropped because there are more routers in the path than the TTL
  • It will be delivered unless there is a routing loop
  • It will be dropped because there are an even number of routers on the path

Quiz 60: The Internet Control Message Protocol (ICMP)

Q1. An ICMP destination unreachable message is returned when ______.

  • When the don’t fragment flag is set in a packet that is greater than the size of the MTU.
  • When the network, host, port, or protocol are unreachable
  • When the packet is sent to a router that believes that a better path exists via another router on the same LAN.

Q2. An Fragmentation Needed message is returned when ______.

  • When the don’t fragment flag is set in a packet that is greater than the size of the MTU
  • When the network, host, port, or protocol are unreachable
  • When the packet is sent to a router that believes that a better path exists via another router on the same LAN

Q3. An Redirect message is returned when ______.

  • When the don’t fragment flag is set in a packet that is greater than the size of the MTU
  • When the network, host, port, or protocol are unreachable
  • When the packet is sent to a router that believes that a better path exists via another router on the same LAN

Quiz 61: Address Resolution Protocol (ARP)

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?

  • Yes, because host D has not been in contact with host A yet
  • It wouldn’t, because the entry for host A is in the ARP cache of host D.
  • It wouldn’t, because host D already knows about every other host on the network

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?

  • Yes, it will because C has not sent a broadcast frame on the LAN segment so far and so an entry for it is not in D’s ARP cache.
  • Yes, it will because D knows about every other host on the network
  • No it will not because D and C have not been in contact as yet

Quiz 62: Dynamic Host Configuration Protocol (DHCP)

Q1. What are the responsibilities of the DHCP server?

  • To translate host names to IP addresses
  • To forward network traffic to the appropriate host
  • To provide a new IP address to a host that requests it

Q2. Which of the following is NOT true about DHCP?

  • A new IP is assigned from a pool of available addresses
  • An IP has to be renewed every once a while with the DHCP server
  • DHCP runs on TCP

Q3. The source IP address of a DHCP response message is ______ and the destination IP address is ______.

  • Source: 0.0.0.0 Destination: 255.255.255.255
  • Source: 255.255.255.255 Destination: new IP of the requester
  • Source: IP address of DHCP server Destination: 255.255.255.255

Quiz 63: IPv4 in Practice: The Life of a Packet

Q1. When is an ICMP protocol unreachable message sent?

  • When the selected protocol in the packet is not available
  • When the selected protocol is TCP
  • When the host is unavailable

Q2. What happens if a router receives a packet with a TTL of 0?

  • It sends an Exceeded ICMP message back
  • This is not possible
  • It drops the packet

Q3. What happens if the packet is larger than the MTU?

  • It is always fragmented in this case
  • If the Don’t Fragment flag is set to 1, a Fragmentation needed ICMP message is sent back
  • If the Don’t Fragment flag is set to 0, the packet is fragmented
  • Both A and B
  • Both B and C

Quiz 64: Why IPv6?

Q1. What’s a compact way of representing the IPv6 address: FE00:0:0:0:219:A34F:F3D7:1204?

  • FE00::219:A34F:F3D7:1204
  • FE00::219:A34F:F3D7::
  • FE::::219:A34F:F3D7:12:4

Q2. An advantage of IPv6 is that its header is smaller than the IPv4 header.

  • True
  • False

Q3. IPv6 is NOT backwards compatible.

  • True
  • False

Quiz 65: IPv6 Features

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?

  • 64 bits
  • 52 bits
  • 12 bits

Q2. What is the IPv6 address ::1?

  • Loopback
  • Multicast
  • DHCP

Q3. Which of the following is definitely NOT an IPv6 multicast address?

  • FFC0:0:0:0:0:0:ABF1:1
  • FF01:0:0:0:0:0:0:1
  • 7F81::0:0:EF13:0:0:1:1

Quiz 66: Middleboxes: Firewalls

Q1. What is the purpose of firewalls?

  • They speed up the traffic that passes through them
  • They only allow certain types of traffic to pass through them
  • They ensure that only packets with a valid checksum pass through them

Q2. A host-based firewall and antivirus program are the same thing

  • True
  • False

Quiz 67: Middleboxes: NATs

Q1. Suppose several end systems including a web server is behind a NAT. Will external clients be able to initiate connections with it?

  • Yes
  • Most Likely Not

Q2. Which of the following is a disadvantage of NAT?

  • The end-to-end transparency of a network breaks
  • The number of IPv4 addresses used is decreased
  • The network speeds up

Q3. One key advantage of NAT devices is that they help conserve the number of IPv4 addresses in use.

  • True
  • False

Quiz 68: Introduction to Routing in IP: Intradomain & Interdomain

Q1. Why are domains needed?

  • For security purposes. Separating the Internet into domains makes it more secure.
  • Every single router would otherwise have to manage routing entries for the entire Internet which is not scalable
  • They are important to make the public adapt IPv6 addresses

Q2. Interdomain routing protocols allow the exchnage of routing information between _____.

  • Domains
  • Routers in a domain
  • Middleboxes

Q3. Intradomain routing protocols allow the exchange of routing information between _____.

  • Domains
  • Routers in a domain
  • Middleboxes

Quiz 69: Interdomain Routing: Border Gateway Protocol

Q1. What would be the AS path to the prefix P10 in AS1?

  • AS1 AS2 AS3 R10 P10
  • AS2 AS3 R10 P10
  • AS2 AS3 P10

Q2. What would be the AS path to the prefix P10 in AS2?

  • AS3 P10
  • AS2 AS3 R10
  • AS1 R10

Quiz 70: Border Gateway Protocol: Determining the Best Routes

Q1. Hot potato routing always results in the overall least cost path being chosen.

  • True
  • False

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?

  • R1
  • R7
  • R4

Quiz 71: What is The Data Link Layer?

Q1. What is the name of a data link layer message?

  • A packet
  • A segment
  • A frame

Q2. What is a key responsibility of the data link layer?

  • It makes communication possible over a physical link that just transports 0s and 1s between two directly connected hosts.
  • It transports data reliably
  • It passes data from one application on a host to the other

Quiz 72: Principles of The Data Link Layer: The Framing Problem

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

  • The entire sequence is one frame
  • There is an error. A sequence like this cannot be received
  • The frame is the bold part here 111001111110010001010100011111010
  • The frame is the bold part here: 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?

  • 010001010100
  • 1110011111100100010101000111111010
  • 11100100010101000111111010

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.

  • 3 8 DLE STX 7 8 DLE DLE ETX
  • 3 8 DLE STX 7 8 DLE DLE ETX DLE ETX
  • 3 8 DLE STX 7 8 DLE DLE ETX DLE ETX

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?

  • 3 8 DLE STX 7 8 DLE DLE ETX DLE ETX
  • 7 8 DLE ETX
  • 7 8 DLE ETX DLE

Quiz 73: Principles of The Data Link Layer: Error Detection

Q1. What would be the parity bit for the following string in an odd parity scheme?

100101001

  • 0
  • 1

Q2. What would be the parity bit for the following string in an even parity scheme?

100100001

  • 0
  • 1

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

  • Yes
  • No

Quiz 74: Medium Access Control: Static Allocation

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 ______.

  • 30 MHz
  • 1 MHz
  • 3 MHz

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.

  • 140 ms
  • 150 ms
  • 10 ms

Quiz 75: Medium Access Control: Stochastic Methods – ALOHA

Q1. Slotted ALOHA improves channel utilization

  • True
  • False

Q2. Which of the following is the most accurate and thorough description of the basic operation of ALOHAnet?

  • Senders send frames and wait for acknowledgements. The next frame is sent after the previous one is acknowledged.
  • Senders send frames and wait for a timeout on that frame or for an acknowledgment. If a timeout occurs, the frame is resent after some wait, and if an acknowledgment is received, the next frame is sent.
  • Senders send frames and wait for a timeout on that frame. If a timeout occurs, the frame is resent after some wait.

Quiz 76: Medium Access Control: Stochastic Methods – CSMA

Q1. What’s the difference between persistent and non-persistent CSMA?

  • Persistent CSMA constantly monitors the channel to determine when it is free, whereas non-persistent CSMA checks the channel at random intervals.
  • Non-persistent CSMA constantly monitors the channel to determine when it’s free, whereas persistent CSMA checks the channel at random intervals.
  • Persistent CSMA doesn’t monitor the channel to determine when it’s free whereas non-persistent CSMA checks the channel at random intervals.

Q2. Does non-persistent CSMA provides higher channel utilization?

  • Yes
  • No

Quiz 77: Medium Access Control: Stochastic Methods – CSMA/CD

Q1. What would happen if a collision occurs and regular CSMA was deployed?

  • Both hosts will continue to transmit the frame even after collision
  • Both hosts will immediately stop transmitting the frame as soon as collision is detected
  • Both hosts will crash immediately

Q2. How does a sending host detect a collision?

  • When it can no longer send more data, it assumes a collision has occurred
  • It compares what is on the wire with what it has sent, if they are equal, a collision has occured
  • It compares what is on the wire with what it has sent, if they are NOT equal, a collision has occured

Q3. How does a receiving host detect a collision?

  • It compares what is on the frame with a string of what it expects to receive, if they are equal, a collision has not occured
  • If it cannot decode what’s on the frame, i.e., a signal that does not represent a 1 or a 0 is received, it assumes a collision has occured
  • If the parity bit is not as expected, it assumes a collision has occured

Quiz 78: Medium Access Control: Stochastic Methods – Optimizing CSMA/CD

Q1. Why is a minimum frame size necessary?

  • To decrease the chances of a bit error
  • To allow sending hosts to be able detect collision while sending a frame
  • To allow receiving hosts to be able detect collision while sending a frame

Q2. Which of the following best describes how removing acknowledgments has improved the data link layer?

  • This freed up a lot of bandwidth.
  • Any transmission errors are mostly caused due to collisions. Fewers frames means fewer collisions and so fewer errors.
  • Acknowledgments at the data link layer are completely unnecessary since upper layers use them

Quiz 79: Introduction to Ethernet

Q1. Which of the following is NOT a valid unicast MAC address?

  • 100110110100101011111010110000011100001001001101
  • 000111111100111110001110110010100111001100010111
  • 000100101001000000011011001010010010010011100011

Q2. How many OUIs are available?

  • 24
  • 2^{24}=16777216
  • 2^{16}=65536

Q3. What does the following command do?

ifconfig ens4

  • Prints all the MAC addresses of the interface ens4
  • Prints the MAC address of the interface ens4
  • Prints all the MAC addresses of the machine

Quiz 80: Ethernet Frame Format

Q1. What would be the total size of a minimal sized TCP packet encapsulated inside an IP packet, encapsulated inside an Ethernet frame?

  • 58 bytes
  • 64 bytes
  • 1500 bytes

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!

  • IPv4
  • IPv6
  • ARP

Quiz 81: Physical Layers for Ethernet

Q1. Which of the following is an advantage of 10BaseT?

  • Maximum distance between stations was reduced compared to Ethernet
  • It has fewer points of failure than 10Base5, 10Base2, and 10BaseF and so is more reliable
  • The frame size was increased from Ethernet

Q2. Fast Ethernet is NOT compatible with slower Ethernet technologies

  • True
  • False

Q3. Which of the following most accurately describes the function of an Ethernet hub?

  • It forwards a signal from one incoming port to one other relevant interface
  • It forwards an incoming signal from one incoming interface to all the interfaces
  • It forwards an incoming signal from one incoming interface to every other interface besides the one that the signal came in on

Quiz 82: Ethernet Switches

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?

  • Yes
  • No

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?

  • Yes because switch will flood the network with the message ensuring that all host D receives it.
  • No since the message has not passed through switch 2, it does not have an entry for host D.

Programming Challenge 3: Spanning Tree Protocol

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()

Quiz 83: Virtual LANs

Q1. Only ONE VLAN can be configured on one Ethernet switch

  • True
  • False

Q2. ONE VLAN can span over MULTIPLE switches

  • True
  • False

Computer Networks Exam

Q1. Which of the following is a valid socket address?

  • 128.255.255.256 / 4000
  • 128.130.30.24 / -4000
  • 128.32.24.6 / 3200
  • 128.32.-24.0 / 80

Q2. Which of the following has the fastest transmission rate?

  • Cable
  • Satellite
  • Dial-up
  • FTTH

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?

  • Mesh
  • Ring
  • Star
  • Tree

Q4. The encryption of data is done in the ____ layer of the OSI model?

  • Application
  • Presentation
  • Session
  • Transport

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?

  • 404 Page Not Found
  • A blank web page
  • Default page
  • 400 Bad Request

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?

  • Send me a text document in the English language
  • Send me a video file in the English language
  • Send me a text document in the French language
  • Send me a video file in the French language

Q7. Electronic mail uses which Application layer protocol?

  • HTTP
  • HTTPS
  • SMTP
  • FTP

Q8. ____ address is used to uniquely identify an application/process running on a machine.

  • IP
  • Port
  • Mac
  • Both A and B

Q9. Which transport layer protocol is preferable for live video streaming?

  • TCP
  • UDP
  • HTTP
  • DHCP

Q10. Which of the following statement is not true?

  • Flow control is used to throttle the transmission rate from the sender side so that the receiver side can handle the data rate.
  • Congestion control is done by the sender in order to avoid congestion on network devices such as routers.
  • Flow control is used by TCP while congestion control is used by UDP.
  • Both congestion and flow control are used by TCP.

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 ____?

  • 42
  • 43
  • 44
  • 45

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?

  • 10 ms
  • 8 ms
  • 6 ms
  • 5 ms

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?

  • Listening at (‘127.0.0.1’, 3000)
  • Listening at (‘0.0.0.0’, 0)
  • Listening at ()
  • Bind error

Q14. Which combination of socket family and type of socket is used to create a datagram socket?

  • AF_ROUTE, SOCK_DGRAM
  • AF_INET, SOCK_DGRAM
  • AF_INET, SOCK_STREAM
  • AF_KEY, SOCK_DGRAM

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?

  • Recv()
  • Listen()
  • Accept()
  • both A and B

Q16. Which one of the following is a correct order of the functions to be called for a TCP client?

  • socket(), bind(), accept(), send(), recv(), close()
  • socket(), bind(), accept(), sendto(), recvfrom(), close()
  • socket(), bind(), connect(), send(), recv(), close()
  • socket(), bind(), connect(), sendto(), recvfrom(), close()

Q17. Which system call in socket programming results in the sending of SYN packets?

  • Bind
  • Connect
  • Listen
  • Accept

Q18. When a router receives a packet that is not destined to itself, it ____.

  • discards that packet
  • sends it back to the sender
  • passes it to the next available router in the network
  • looks up the destination address in the forwarding table

Q19. What would the initial routing table look like at C for the below network topology with distance vector routing?

  • Destination Count Next Hop A 5 A B 3 B D 1 D
  • Destination Count Next Hop A 5 A B 3 B D 1 D E 4 D
  • Destination Count Next Hop A 5 C B 3 C D 1 C
  • Either A or B

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?

  • 14
  • 15
  • 16
  • 30

Q21. When calculating the usable hosts per subnet, the following formula is used (2bits – 2). For what reason is two subtracted?

  • Broadcast address
  • Multicast address
  • Network address
  • Both A and C

Q22. If a packet has to travel from autonomous system A to autonomous system B, which routing protocol is preferable?

  • OSPF
  • BGP
  • RIP
  • DHCP

Q23. The ____ address is added by the data link layer to the frame.

  • Logical
  • Physical
  • Network
  • Both B and C

Q24. Which of the following task is performed by the data link layer?

  • Error control
  • Flow control
  • Frame synchronization
  • All of the above

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:

  • TCP
    HTTP
    UDP
    IP
    SSL
    ICMP
  • Application
    Presentation
    Transport
    Network
    Data Link

Q26. Match the layer name given in the left column with the respective name of the packet in that layer:

  • Application layer
    Transport Layer
    Network Layer
    Data-Link Layer
  • Frame
    Message
    Segment
    Datagram

Q27. POP is a pull protocol.

  • True
  • False

Q28. Bind error happens if you use different port numbers for the client and server sides in TCP.

  • True
  • False

Q29. Devices configured over IPv4 can not access websites on servers configured with IPv6.

  • True
  • False

Q30. In CSMA/CD, the acknowledgment frames in the data link layer have been completely removed.

  • True
  • False

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:

Conclusion:

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 >>

LeetCode Solutions

Hacker Rank Solutions

CodeChef Solutions

Leave a Reply

Your email address will not be published. Required fields are marked *