CSC645/745

We're gona ACE this quiz and the rest of the quizzes! :p

=Review #1=

Question 1 - Define networking terms
'''1. Define the following terms: protocol, network, network structure, internetwork, network architecture, protocol hierarchy, layer, level-n protocol, level n-1 interface, physical medium, service primitives. '''


 * Protocol: A protocol defines the format and the order of messages exchanged between two or more communicating entities, as well as the actions taken on the transmission and/or receipt of a message or other event. It defines peer-to-peer communications.
 * Network:  1 distributed system where communications are connected, means to transfer messages (data) between components in a single distributed system
 * Network Structure:	How components are physically connected. Example media: twisted pair wire, fiber optic cable, microwave channel. Two flavors: Point-to-point and multiple access
 * Internetwork: Take any networks of any sort and combine it to become bigger networks where routers are used to configure these networks. Means to transfer messages (data) between networks (i.e. between components in different distributed systems). A specific set of networks connected by routers that are configured to pass traffic among any computers attached to networks in the set. Most internets use TCP/IP protocols.
 * Network architecture: The design of a computer network. A set of layers and corresponding protocols
 * Protocol hierarchy: We have different layers on top of the physical media for the client and server that are connected via peer to peer protocols.
 * Layer: Well defined collection of functions. Run-time entities perform the functions defined by each layer.
 * Level-n protocol: Peer-to-peer communication on the same level n. Logical description of what peer is doing.
 * Level n-1 interface: Communication connection between level n and level n-1 protocol.
 * Physical medium: Physical material capable of holding data (i.e. wire, magnetic tape).
 * Service primitives: Communication operations that steps through a transfer of data.

Question 2 - point-to-point vs. multiple access
'''2. What is the difference between point-to-point and multiple access networks? '''


 * Point-to-Point Networks:
 * A collection of links that are connected by nodes.
 * Able to send a transmition (data) from links to links from the source to the destination
 * Developed in 1960s~1970s
 * OSI/ISO standards
 * Have dedicated links between pairs of components.
 * Types: star, ring, tree, complete, irregular (most common)-> Impossible to do math analysis. Least discussed
 * ISSUE: Network topology (which pairs of components have links)
 * Multiple access networks:
 * Single shared communication channel
 * Types: Satellite/radio, ethernet, token ring
 * Ethernet: more for LAN. 1 to aparnet and 1 connected to ethernet
 * ARPANET: connection out of the network in Europe
 * TCP/IP Protocols
 * ISSUE: Channel allocation (who's turn it is to use the media).

Question 3 - internetwork vs. network
'''3. How is an internetwork different from a network? Why are both necessary? '''
 * Internetwork
 * Consists of various kinds of networks but connected using a router.
 * Uses the TCP/IP
 * Not ISO protocols.
 * Last 10yrs are ISO compliants.
 * Means to transfer messages (data) between networks (i.e. between components in different distributed systems). A set of networks connected by routers that are configured to pass traffic among any computers attached to networks in the set. Most internets use TCP/IP protocols.
 * Network:
 * A single distributed system where communications are connected.
 * means to transfer messages (data) between components in a single distributed system


 * why both are necessary
 * An internetworks allows for communication between two or more networks that can be of different infrustructures. It also allows for LANs to become WANs.

Question 4 - level n-1 interfaces
'''4. Why don't network architectures specify the level n-1 interfaces? '''

The network architectures do not specify the level n-1 interfaces because these are not visible "outside" of the computer executing the protocol code.

Question 5 - communication between levels
'''5.	Why isn't communication between peers on different levels allowed? '''

Communication isn't allowed between peers on different levels to avoid the mix up of code (spaghetti code). Make the programming for each level a much simplier task for the programmer and to allow each level to work more efficiently.

Each of the layer in the architecture have a peer-to-peer protocol to communicate with the same layer level. Each of this layers have APIs and interfaces that separates them. A change on a lower level of the network stack should not affect the APIs that are defined higher and thus does not need the developer to rewrite the calls to the APIs. The change should be seemless.

Quiz #1

Question 6 - purpose of the interface control information
'''6.	What is the purpose of the interface control information (ICI) added by the level n entity. Does this information get delivered to the remote level-n peer? '''

Interface control infromation is control information added by a peer (service user) for the peer on the layer immediately below (service provider) and is removed by that peer.

This infromation does not get delivered to the remote level n peer but the level immediately below that.

Question 7 - purpose of the header information
'''7.	What is the purpose of the header information added by the level n entity? Does this information get delivered to the remote level n peer? '''

The header contains control information added by the level n peer for the corresponding peer on the same peer on the same level.

The information does get delievered to the remote level n peer.

Question 8 - level N PDU and the level N+1 PDU
'''8.	What is the relationship between the level N PDU and the level N+1 PDU? '''


 * PDU (Protocol Data Unit)
 * Message locally sent between 2 peers on the same level.
 * Consists of a header and a SDU (Service Data Unit).


 * SDU (Service Data Unit)
 * Message that is passed down the protocol stack via a service access point from an upper layer peer for delivery to a remote peer.



Question 9 - Protocol
'''9.	What is a protocol? How is it defined? '''

A protocol is defined by the format of messages exchanged and the legal exchange of sequences. It defines peer-to-peer communication, logical description of what the peer is doing.

Question 10 - 4 classes of service primitives
'''10.	What are the four classes of service primitives? '''
 * 1) Request a service
 * 2) Indicate that request has arrived
 * 3) give Response to request
 * 4) Confirm that request arrived

Question 11 - service primitives and ISO/OSI standards
'''11.	How are service primitives used in the ISO/OSI standards? '''

Upper layer (service user) asks for service and lower layer (service provider) provides service. Both are connected through a service access point.



Question 12 - confirmed message delivery vs. unconfirmed message delivery
'''12.	What is the difference between confirmed message delivery and unconfirmed message delivery? '''


 * Confirmed Message Delivery
 * Request + Indication + Response + Confirmation


 * Unconfirmed Message Delivery
 * Request + Indication

Question 13 - sequence of service primitives for delivery of confirmed message
'''13.	Describe the sequence of service primitives used to implement delivery of a confirmed message. '''

A picture paints a thousand words ;)



Question 14 - sequence of service primitives for delivery of unconfirmed message
'''14.	Describe the sequence of service primitives used to implement delivery of an unconfirmed message. '''

Another 10,000 words ;)



Quiz #2

Question 15 - ISO/OSI Layers
'''15.	What are the seven ISO/OSI layers? Give a one sentence description of each layer. '''

"All People Seem To Need Data Processing." :p remember that sentence.


 * 1) Physical Layer: Transmission of bits on a single link.
 * 2) Data Link Layer: Error free transmission of packets on a single link
 * 3) Network Layer: End-to-End transmission of packets
 * 4) Transport Layer: End-to-End delivery of messages flow control
 * 5) Session Layer: Setup and manage end-to-end conversation between users, provide enhance data transport and dialog control
 * 6) Presentation Layer: Control syntax and semantics of information transmitted
 * 7) Application Layer: High level user services as well as high level generic services

Question 16 - Physical Layer
'''16.	Describe the major functions of the ISO/OSI physical layer. '''


 * Transmission of bits on a single link.
 * DTE-DCE Data Transfer.
 * Control Signal between devices.
 * Clocking signals: suncrhonize data flow and regulate bit rate.
 * Electrical Ground
 * Mechanical connectors (sockets and plugs).

Question 17 - Data Link Layer
'''17.	Describe the major functions of the ISO/OSI data link layer. '''

Error free transmission of packets on a single link (flow control, line coordination).

Question 18 - Network Layer
'''18.	Describe the major functions of the ISO/OSI network layer. '''

End-to-End transmission of packets (subnet control, routing, congestion control, accoounting, network interface/gateway).

Question 19 - Transport Layer
'''19.	Describe the major functions of the ISO/OSI transport layer. '''

End-to-End delivery of messages (manage communication bit pipes between process) flow control.

Question 20 - Session Layer
'''20.	Describe the major functions of the ISO/OSI session layer. '''

Setup and manage end-to-end conversation between users, provide enhance data transport and dialog control.

Question 21 - Presentation Layer
21.	Describe the major functions of the ISO/OSI presentation layer.

Control syntax and semantics of information transmitted (formatting, compression, encryption).

Question 22 - Application Layer
'''22.	Describe the major functions of the ISO/OSI application layer. '''

High level user services (virtual terminals, file transfer, email, etc) as well as high level generic services (remote operations, reliable delivery, etc).

Question 23 - TCP/IP Layers
'''23.	What are the four (five) TCP/IP layers? Give a one sentence description of each layer. '''
 * 1) Hardware Layer: Physical bit transport
 * 2) Hardware Interface Layer: Transmit datagrams over specific network using physical address to identify hosts
 * 3) Transport Layer: Provide communication from one machine to another.
 * 4) User Services Layer: Provide communication between users (processes).
 * 5) Application Layer: Choose style of tranport and transfer data. Messages of streams of data are exchanged between peers

Question 24 - Hardware Layer
24.	Describe the major functions of the TCP/IP hardware and hardware interface layers (0 and 1).


 * Layer 0: Physical bit transport
 * Layer 1: Transmit datagrams over a specific network using physical addresses to identify hosts.
 * Not Part of TCP/IP protocols

Question 25 - Transport Layer
'''25.	Describe the major functions of the TCP/IP transport (IP) layer. '''


 * Provide communication from 1 machine to another.
 * IP datagrams are exchanged between peers.


 * IP (Internet Protocol): Datagram delivery service.
 * ICMP (Internet Control Message Protocol): Handle Error and control information.
 * ARP (Address Resolution Protocol): Translate IP addresses into physical addresses.
 * RARP (Reverse Address Resolution Protocol): Translate physical addresses into IP Addresses.

Question 26 - User Services Layer
'''26.	Describe the major functions of the TCP/IP user services (TCP/UDP) layer. '''


 * Provide communication between users (processes).
 * Transport protocol packets are exchanged between peers.


 * TCP (Transfer Control Protocol) Layer
 * Reliable
 * Full-duplex
 * Stream connection between processes
 * Connection oriented.


 * UDP (User Datagram) Layer
 * Connectionless protocol between processes
 * Messages are not guranteed to arrive.

Question 27 - Application Layer
'''27.	Describe the major functions of the TCP/IP application layer. Why is this layer usually not included as part of the TCP/IP protocol stack? '''


 * Choose style of transport and tranfer of data.
 * Messages or streams of data exchanged between peers (user application processes).


 * Why is the application layer not part of TCP/IP protocol stack?
 * The application layer is the top layer of the TCP/IP protocol I don't know :p

Question 28 - TCP/IP Layer Vs. ISO/OSI Layering
'''28.	How is TCP/IP layering different from ISO/OSI layering? '''


 * TCP/IP
 * End-to-End Reliability
 * Locus of intelligent decision making
 * Hosts
 * Layering = Description of Functionality


 * ISO/OSI
 * Link level Reliability
 * Locus of intelligent decision making
 * Network IMP's
 * Layering = Blueprint for implementation

Question 29 - connectionless vs. connection-oriented service
'''29.	What is the difference between connectionless and connection-oriented service? '''
 * Connectionless service	
 * No logical connection established between peers before data exchange.
 * Message may arrive in any order (may not arrive at all).
 * Difficult to account for network resource utilization.
 * Connection-oriented service
 * Peer entities set up logical connection before data transfer.
 * During data transfer, all messages are delivered in order (usually guranteed to be delivered).

Question 30 - Define "-plex" terms
30.	Define the following terms: full duplex, half duplex, simplex 
 * Full duplex	: Data transfer in both directions at the same time.
 * Half Duplex	: Data transfer is both directions, but only 1 direction at a time.
 * Simplex	: Data transfer in only 1 direction.

Question 31 - Protocols
'''31.	Which protocols of TCP/IP are connectionless? Connection-oriented? Which layers of the ISO/OSI protocol are connectionless? Connection-oriented? '''


 * TCP/IP
 * Connectionless
 * Hardware (Layer 0) -- Service must be provided or emulated
 * Hardware Interface (Layer 1) -- Service must be provided or emulated
 * Layer 2 IP & Friends (ARP, ICMP, RARP)
 * Layer 3 UDP


 * Connection-Oriented
 * Layer 3 TCP


 * ISO/OSI Protocol Layers
 * Connectionless
 * MAC Layer
 * LLC Layer (Pass through MAC)
 * Transport Layer (Pass through MAC)
 * Session Layer
 * Presentation Layer
 * Application Layer


 * Connection-Oriented
 * Physical Layer
 * Data Link Layer
 * Network Layer
 * LLC Layer (Pass through MAC)
 * Transport Layer (Pass through MAC)

=Review #2 - Physical & Mac Layers=

Question 1 - major functions of physical layer
1. What are the major functions of the physical layer?


 * DTE-DCE Data Transfer
 * Control signals between devices
 * clocking signals: synchronize data flow & regulate bit rate
 * electical ground
 * mecanical connectors (sockets & plugs)

Question 2 - functionality of physical layer
2. How is the functionality of the physical layer defined?


 * The physical layer is connection-oriented and uses unconfirmed messages.

Question 3 - physical layer services
'''3. Are the physical layer services confirmed or unconfirmed? Explain your answer. '''


 * It is unconfirmed. There is only request and indication. No response or confirmation.

Question 4 - service primitives - data link layer
'''4. Describe the sequence of service primitives that the (data link) sender uses to transfer a sequence of packets. Describe the sequence of primitives that the (data link) receiver uses. '''

Answer: Since data link layer is connection oriented, we can conclude that both sender and receiver uses confirmed service i.e. request + indication + response + confirmation.

Question 5 - state changes of simplex - duplex communication
'''5. How are the state changes exhibited by the sender and receiver different for simplex and duplex communication? '''

With simplex, communication is one-directional. E.g. Television. That is, it goes one way and cannot come back to the original state. With duplex, you can return to the original state since the communication is bi-directional. Half Duplex e.g. Walkie talkie. Full Duplex e.g. Phone.

Question 6 - manchester encoding
6. Why is Manchester Encoding useful?

Manchester code is a form of data communication line code in which each bit of data is signified by at least 1 voltage level transition. It is used by the physical layer.

Machester encoding is useful because the signal synchronizes itself. This minimizes the error rate and optimizes reliability.

Question 7 - manchester encoding
7. Give the manchester encoding for the following bit string: 0000011111010101111  



=Supplementary Questions on Physical Layer=

Question 1 - State Diagram
'''1. In the state diagram given in the class notes all legal state transitions are specified. If a state transition is not specified then it is not legal. Another way to represent this information is to have another state (the "error" state) with transitions labeled with each of the out-of-sequence primitives. Add this state to the state diagram. '''



Question 2 - State Diagram(Duplex)
'''2.The state diagram as given allows full duplex communication. Modify the state diagram from question 1 so that it only allows half-duplex communication. Modify the state diagram so that it only allows simplex communication (note: you will need one state diagram for the sender and another for the receiver). '''

This diagram applies for half-duplex for each of the arrow representing 1 directional communication happening only 1 at a time.

Sender

??

Receiver

??

Question 3 - Sequence of primitives
'''3.Which of the following sequences of primitives are legal? (Assume that one site is executing the sequence and that peer is initially in state 1.) Explain your answer clearly! '''Illegal! It dies after PH-data.request'''
 * a. PH-Data.request
 * PH-Data.request
 * PH-Data.request

'''Legal. It finishes up at state 3'''
 * b. PH-Activate.request
 * PH-Activate.indication

'''Legal. It finishes at state 3'''
 * c. PH-Activate.request
 * PH-Deactivate.request

'''Legal. Ends at state 1. '''
 * d.PH-Activate.indication
 * PH-Data.indication
 * PH-Data.indication
 * PH-Deactivate.indication

Question 4 - Sequence of primitives
'''4.Given the following (legal) sequences of primitives, list the sequence of primitives that the corresponding peer will execute, assuming it is initially in state 1. What is the final state of both peers?'''

Ends at State 1 where both channels are inactive.
 * a. PH-activate.request
 * PH-data.request
 * PH-data.request
 * PH-deactivate.request

Ends at State 1 where both channels are inactive.
 * b. PH-activate.request
 * PH-activate.indication
 * PH-data.indication
 * PH-data.request
 * PH-deactivate.indication
 * PH-deactivate.request

QUIZ 3

Question 8 - mac layer service primitives
8. What are the service primitives supported by the MAC layer
 * connection activation
 * PH-activate.request
 * PH-activate.indication
 * data transfer
 * PH-data.request
 * PH-data.indication
 * connection de-activation
 * PH-deactivation.request
 * PH-deactivation.indication

Question 9 - 1 persistent"
'''9. What does "1 persistent" mean? Under what circumstances is this a reasonable policy to use? '''

1 persistent mean that a host transmit with probability of 1 (always) when the media is free.

It is reasonable when there is large bandwidth and many available resources.

Question 10 - CSMA/CD
10. Define CSMA/CD (explain all terms clearly)


 * CS: carrier sense
 * All hosts wait until the media is idle before transmitting.


 * MA: Multiple access
 * All hosts share the same media


 * CD: Collision Detection
 * As hosts transmit, then monitor the media for collisions (2 hosts transmitting at the same time). If collision is detected, host stops transmitting, sends a noise burst, then try again later.

Question 11 - random exponential backoff policy for collision resolution
'''11. Describe the random exponential backoff policy for collision resolution. What happens if the media is unable to deliver packets due to excessively heavy load (or a failure in the network interface)? '''


 * 1) With the first collision, wait 0-1 slot times.
 * 2) After second collision, wait 0-1-2-3 slot times.
 * 3) After ith collision, wait 0-1-...(2**i)-1 slot times until i=10
 * 4) Freeze maximum wait at 1023 slots until 16 collisions.
 * 5) After 16 collisions, return failure.

If the media is unable to deliver packets due to excessively heavy load, it returns a failure.

Question 12 - host sending message to another host
'''12. Explain in your own words what happens when a single host attempts to send a message to another host on an ethernet. '''


 * The sender host sends the message. All other hosts check the data that is transmitted. If the Checksum is incorrect, they discard the message. If it is ok, then they check if the destination address is correct, then they keep the message. If it is not correct, they discard the message.
 * If data in != data out, raise burst, try again later

Question 13 - ethernet transmission
'''13. Explain in your own words what happens if two ethernet hosts attempt to transmit at EXACTLY the same time. '''

If two hosts start speaking at the same time, both stop and wait for short, random periods of time (in Ethernet, this time is generally measured in microseconds). The hope is that by each choosing a random period of time, both hosts will not choose the same time to try to speak again, thus avoiding another collision. Exponentially increasing back-off times (determined using the truncated binary exponential backoff algorithm) are used when there is more than one failed attempt to transmit.

Question 14 - tau
'''14. What is tau? How is it used in designing the ethernet protocol? '''

The 19th letter of the Greek alphabet =P ;)

The maximum delay between hosts.

It is used to help hosts delay after collison

Question 15 - ethernet hosts
'''15. Explain in your own words what happens if two ethernet hosts attempt to transmit at an interval of slightly greater than two tau time units. '''

If a collision happens in time more than tau, then when the collision message comes back, it will not reach the sender host within 2tau. That means that the sender will think that the message got delivered correctly and will continue transmission. tau |<      2tau
 * --|-->X

Question 16 - min msg size ethernet hosts
'''16. How is the minimum message size determined in the ethernet protocol? '''

Each message require at least 2*tau time units for transmission (otherwise the collision detection mechanism might fail).

Question 17 - ethernet hosts
'''17. Why is it necessary to fix the maximum  message size in the ethernet protocol? '''


 * Signal gets degraded with distance
 * Timing issues
 * Depends on medium used

Question 18 - ethernet error
'''18. How does the ethernet hardware detect errors in transmission? '''


 * If data in != data out, raise burst and try again later.
 * Check CRC. If jumbled throw away. If ok, check dest same as controller and if same keep, otherwise throw away.
 * Detect that a collision has occured.

Question 19 - ethernet hosts
'''19. Why are ethernets generally considered to be unsecure media? '''

Because even if data is encrypted, we can still see who is communicating with whom.

Question 20 - ethernet, real time application
'''20. Is ethernet technology appropriate for real time applications? Explain your answer clearly. '''

No because the wait to communicate with other hosts will be too long for the user.

Question 21 - ethernet parts
'''21. How does the system programmer access the Ethernet? What parts of the Ethernet protocol are visible to the programmer? '''

The programmer communicates with the controler that is installed on the computer. The application, Transportation and Network layers are available to the programmer.

Question 22 - ethernet frame
'''22. Describe the fields in an Ethernet frame. '''


 * MAC Header (Source Address (6 bytes), Dest Address (6 bytes), EtherType (2 bytes)) | Data (Payload (46-1500)) | CRC Checksum (4 bytes) |

Examples of EtherType: 0x0800 	Internet Protocol, Version 4 (IPv4), 0x0806 	Address Resolution Protocol (ARP), 0x8035 	Reverse Address Resolution Protocol (RARP), 0x809b 	AppleTalk (Ethertalk), 0x80f3 	AppleTalk Address Resolution Protocol (AARP)

Question 23 - ethernet hosts
'''23. How does thin wire ethernet differ from standard ethernet? '''


 * Uses coaxial cable
 * Requires Transceivers using BNC T-Connector
 * Requires Terminators
 * Have to be very careful that all T-connectors have cables and terminators are installed

Question 24 - ethernet wire
'''24. How are connections made to a thin wire ethernet? Is this more or less difficult than connecting taps/T-junctions to a standard ethernet? '''

More difficult - Requires terminators + Have to have cables on both ends of T-junction.

Question 25 - ethernet 10base-T
'''25. What is 10base-T ethernet? '''


 * Twisted Pair Ethernet.
 * Used with RJ-45 connectors in star topology (all computers connect to a central computer).
 * 10Mbps
 * Uses baseband connection
 * 100 meters

Question 26 - ethernet and local networks
'''26. What are some examples of networking technologies OTHER than ethernet that have been used to build local networks? '''
 * Token Ring
 * Fiber Distributed Data Interface (FDDI)
 * Asynchronous Transfer Mode (ATM)
 * Others

Question 27 - ethernet hosts
'''27. How does gigabit ethernet technology differ from slower ethernet variants? '''


 * Minimum carrier time and Ethernet slot time have been extended from 64 byts to 512 bytes (minimum packet size is still 64 bytes, small packets use carrier extension).
 * Packet bursting allows servers, switches and other devices to send bursts of small packets

=Review # 3 -- Windowing Protocols=

Question 1- Data Link Mechanism
'''1. What are the two mechanisms used by the data link layer for error detection? '''

CRC (Checksum) & Sequence Number.

Question 2- Error Recovery
'''2. How is windowing used for error recovery? '''

It buffers the packets that have been send out from the sender to receiver and receiver to sender. The sender advances the BOT (Bottom of the Window) when an ACK corresponding to the packet in the window arrives, sliding the window over.

Question 3- ABP
'''3. Describe the alternating bit windowing protocol. Explain how messages are sent with and without errors occurring. '''


 * Number packets: 0-1-0-1


 * Sender sends a packet, then waits for an ACK from the receiver before sending the next packet (or possibly resending the current one). If timer expires before the ACK arrives, the last packet is retransmitted.


 * If jumbled bits received by sender (jumbled ACK) then resend the last packet. If jumbled bits received by receiver (jumbled original packet), receiver re-requests the same packet.

Question 4- ABP Sender
'''4. Write very high level pseudocode for the alternating bit protocol sender. '''
 * Initialize SN = 0
 * Send first packet
 * for {
 * receive ack
 * if (ackno == SN) {resend packet; continue}
 * if (no-more-data-to-send) return;
 * set SN = ackno
 * send next packet
 * } on timeout, resend packet

Question 5- ABP Receiver
'''5. Write very high level pseudocode for the alternating bit protocol receiver. '''
 * Initialize RN = 0;
 * for {
 * receive packet //(if checksum is ok then process. else retransmit)
 * if(seqno == RN) {
 * pass data up
 * set RN = (RN + 1)%2
 * } send ackno = RN
 * }

Question 6- GBP Protocol
'''6. Describe the go-back-n protocol. Explain how messages are sent with and without errors occurring. '''


 * Sender transmits an entire window of W pacekts at the same time, receiver only accepts the next packet expected.
 * Number packets 0, 1, 2, ..., W, 0, 1, ... (i.e. +1 mod W+1). Note that there are W+1 different sequence numbres.
 * Receiver is identical to Stop and Wait receiver (except for sequence numbers)

(indicating that all packets up to the sequence numbrer in the ack have safely arrived). When the bottom of the window advances, more packets can be sent at the top of the window.
 * Sender tramsits up to W unacknowledged packets (and buffers them until they are acknowledged)
 * Sender advances the bottom of the window when an ack corresponding to a packet in the window arrives


 * On sender timeout, retransmit some packets in the widnow. Typically all packets in the widnow are retransmitted in order.


 * If jumbled bits received by sender (jumbled ACK) then resend the packet at the BOT. If jumbled bits received by receiver (jumbled original packet), receiver re-requests the same packet.

Question 7- GBP Sender
'''7. Write very high level pseudocode for the go-back-n protocol sender. '''


 * Initalize BOT = 0;
 * send first window of W packets
 * for {
 * receive ack
 * if (ackno not the current window) continue;
 * if (ackno == BOT) {resend window, continue}
 * if (no-more-data-to-send) {
 * if (all ack's received) return
 * send BOT = ackno, continue
 * } set BOT = ackno; continue
 * send any packet new packet at top of window
 * } on timeout, resend window

Question 8- GBP Receiver
'''8. Write very high level pseudocode for the go-back-n protocol receiver. '''


 * initialize RN = 0;
 * for {
 * receive packet
 * if (seqno == RN) {
 * pass data up
 * set RN = (RN + 1) % W+1
 * } send ackno = RN
 * }

Question 9- SRP Protocol
'''9. Describe the selective repeat protocol. Explain how messages are sent with and without errors occurring. '''


 * Sender tramsits an entire window of W packets at the same time, Receiver buffers up to W out of order packets
 * Number packets 0, 1, 2, ..., 2W-1,0,1,... (i.e. +1 mod 2W). Note that there are 2W different sequence numbers!
 * Sender is dentical to go-back-n sender (except for sequence numbers)
 * Receiver buffers up to W packets --i.e. pacekts between BOT and (BOT + (W-1)) % (2W). BOT is the sequence number of the first missing packet and is the bottom of the receiver window.
 * When one or more packets at the bottom of the window have been correctly received, they are packet up and BOT is set to the first missing packet.
 * Receiver sends ack's as in the other sliding window protocols, using BOT as the ack number. Information about which packets are currently buffered may also be send with each ack.
 * If jumbled bits received by sender (jumbled ACK) then resend the packet at BOT. If jumbled bits received by receiver (jumbled original packet), receiver re-requests the packet at BOT.

Question 10- SRP Sender
'''10. Write very high level pseudocode for the selective repeat protocol sender. '''

Same as GBN.

Question 11- SRP Receiver
'''11. Write very high level pseudocode for the selective repeat protocol receiver. '''


 * initialize BOT = 0;
 * for {
 * receive packet
 * if (packet is in window) store in receiver buffer
 * if (bottom of window is full) {
 * pass packets up in order
 * set BOT to sequence number of first missing packet
 * }
 * send ackno = BOT
 * }

Question 12- ABP missing Packets
'''12. Describe how the alternating bit protocol handles missing packets and acknowledgements. Can this protocol send duplicate packets or acknowledgements? '''


 * On timeout, sender resends the last packet.
 * If jumbled bits received by sender (jumbled ACK) then resend the last packet. If jumbled bits received by receiver (jumbled original packet), receiver re-requests the same packet.
 * No to both (?)

Question 13- GBP missing Packets
'''13. Describe how the go-back-n protocol handles missing packets and acknowledgements. Can this protocol send duplicate packets or acknowledgements? '''


 * On timeout, sender resends the packet at BOT.
 * If jumbled bits received by sender (jumbled ACK) then resend the packet at BOT. If jumbled bits received by receiver (jumbled original packet), receiver re-requests the packet at BOT.
 * We can have duplicate acknowledgements, but not duplicate packets sent from sender at the same window transmission.

Question 14- SRP missing Packets
'''14. Describe how the selective repeat protocol handles missing packets and acknowledgements. Can this protocol send duplicate packets or acknowledgements? '''


 * On timeout, sender resends the packet at BOT.
 * If jumbled bits received by sender (jumbled ACK) then resend the packet at BOT. If jumbled bits received by receiver (jumbled original packet), receiver re-requests the packet at BOT.
 * No to both (?)

Question 15- ABP buffer space
'''15. How much buffer space is required for the alternating bit protocol? '''

2 for sender, 2 for receiver(, same for full duplex) Answer = 4

Question 16- GBP buffer space
'''16. How much buffer space is required for the go-back-n protocol? '''

Sender=W+1, Receiver=2+1 (full duplex=2W+2) Answer = W+4 (?)

Question 17- SRP buffer space
'''17. How much buffer space is required for the selective repeat protocol? '''

Sender=W+1, Receiver=W+1(, full duplex =2W+2)

Answer=2W+2 (?)

Question 18- Piggybacking
'''18. What is piggybacking? Why is it useful? '''

Piggybacking is used with full duplex communication to send with acknowledgment tbe next data packet going in the right direction, and waits a limited amount of time if no data packets are ready to go.

It is useful because it improves the efficiency in which data gets transmitted.

Question 19- Positive Acknowledgement
'''19. What is a positive acknowledgement? How is it used? '''

the receiver explicitly notifies the sender which packets, messages, or segments were received correctly which may implicitly inform the sender which packets were not received even though they were sent and thus may need to be retransmitted.

Question 20- Negative Acknowledgement
'''20. What is a negative acknowledgement? How is it used? '''

The receiver explicitly notifies the sender which packets, messages, or segments were received incorrectly and thus may need to be retransmitted.

Question 21- Cummulative Acknowledgement
'''21. What is a cumulative acknowledgement? How is it used? '''

The receiver acknowledges that it correctly received a packet, message, or segment in a stream which implicitly informs the sender that the previous packets were received correctly. TCP uses cumulative acknowledgement with its TCP sliding window

Question 22- ISO support
'''22. Why does ISO support BOTH the standard physical/data link protocols and the MAC protocol suite? '''

QUIZ #4

=Review 4: Internetworking and Addressing, Network Layer=

Question 1 - Internet
'''1. What are the major functions provided by the internet? '''


 * To hide underlying network architecture.
 * Provide access to all networks (without direct connections).
 * Provide standard network interface that is independent of network topology.

Question 2 - IP Addresses
'''2. What is the format of IP (DARPA) addresses? Why are IP addresses needed in addition to network physical addresses? '''

All machine share a global space of identifiers.


 * Format of IP DARPA addresses
 * Name：What an object is.
 * Address: Where an object is.
 * Route: How to get to an object.


 * IP addresses are needed in addition to network physical addresses is because the physical address only identify the object (i.e. router, computer) while the IP address gives the location of where the object is and how to get to it.

The internet maps identifier to a machine location.

Question 3 - IP Addresses
'''3. What are the different classes of IP addresses? Why are multiple classes needed? '''

IPv4 address: (netid, hostid) netid: network identifier hostid: host identifier


 * 3 Primary Different classes of IP addresses:
 * Class A: 0 + netid(1-7) + hostid(3-31)
 * Class B: 10 + netid(2-15) + hostid(16-31)
 * Class C: 110 + netid(3-23) + hostid(24-31)

Multiple classes are needed because different machines have different conventions of storing integer values.

Question 4 - Binary Notation
'''4. Give dotted decimal notation for the following binary number: 00010101 11001010 00011111 01010101. '''

21.202.21.85

using the bit notation with base 2 128 64 32 16 8 4 2 1

Question 5 - Standard Byte Order
'''5. Why is it important to have a standard byte order for integer data sent over the internet? '''

It is important to have a standard byte order for integer data sent over the internet because different machines uses different conventions for storing integer values.

--- QUIZ #5 ---

Question 6 - RARP
'''6. What is RARP used for? '''

RARP: Reverse Address Resolution Protocol. It Translate physical address to IP address RARP is used to respond to ARP messages. The recepient of te ARP message after sending a ARP reply, sends an RARP request to the original sender and once it gets a reply, then transmission of packets can occur.

Question 7 - RARP
'''7. Describe the sequence of events that occur when RARP is invoked. '''

Diskless host broadcasts ARP request (giving physical address) and waits for server to respond with UP address (with timeout). On receipt of response, hose verifies physical address and stores IP address in a local table.

Question 8 - ARP
'''8. What is ARP used for? '''

ARP is the address resolution protocol. It translate IP addresses into physical addresses.

Question 9 - ARP
'''9. Describe the sequence of events that occur when ARP is invoked. '''

ARP's packets are send over the next hop using the underlying network. The source and destination machines are identifies by their physical addresses.

When an ARP is involved, it broadcast a request (giving IP address) and wait for host to respond with physical address (with timeout).

Question 10 ARP Protocol
'''10. Under what circumstances is ARP NOT an appropriate protocol to use for address mapping? '''

Two machines on a given physical network can communicate only if they know each other's physical network address. ARP not appropriate when the physical networks don't know each other's physical network address(?).

Question 11 ARP Cache
'''11. What is the purpose of the ARP cache? What does it contain? '''

ARP maintains the mapping between IP address and MAC address in a table in memory called ARP cache. The ntries in this table are dynamically added and removed.

It contains recently translated (IP physical address) pairs.

Question 12 LAN
'''12. What address is used to forward packets over the local network? '''

The IPv4 address is used to forward packets in the local network.

Question 13 Routers
'''13. How do routers (gateways) know where to sent packets? '''

Each router (and hosts) are identified by IP address associated with it. The IP address is decided by the controller board. Each controller have a unique hardware address. Each router will decide where the packet packet is sent through the next router until its destination. Each packet sent will contain the source IP, destination IP and the message. The hosts will know where to send the next packet using the ARP protocol.

Question 14 IP Router
'''14. Explain the sequence of steps that occur at each IP router when a packet is forwarded through that router. '''

Hosts send packets to local routers, routers forward packets on to another router towards the final destination. The IP routers forward packets based on information stored in a routing table. IP assumes that routing table exists. The routing table entries consist of network ID,router IP address pairs. Each entry indicates that packets directed towards that network should be sent to the associated router (IP address)


 * IP Routing Algorithm*
 * Extract destination address
 * Computre destination netid
 * if net is difrectly connect, send, datagram oer that network (using physical address)
 * else if host specific route, route to that gateway
 * else if network appears in table, send to that gateway
 * else if default in table, send to that gateway
 * else error

Question 15 IP Packets, Physical Layer
'''15. Explain how IP packets are encapsulated within physical layer (say ethernet) packets. '''

The Physical layer is responsible for encoding and transmission of data over network communications media. It operates with data in the form of bits that are sent from the Physical layer of the sending (source) device and received at the Physical layer of the destination device.

Question 16 IP router
'''15. What happens when an IP router receives more packets than it has buffer space to store them (i.e. when packets arrive faster than they can be forwarded)? '''

When this buffer space is filled, the router starts to discard packets at random from its queue. Packet queue data buffers are 256 bytes in length. Therefore, the value of this parameter must be a multiple of 256. Multiple buffers are chained together for larger packets. The IP header for a packet is stored separately. This parameter is ignored and no buffers are allocated if the IP router is not enabled.

Question 17 - Round Trip Delivery
'''17. Why is it difficult to estimate the round trip latency for messages sent over the internet using IP? '''

Latency (or delay) is the round-trip time for a small data packet to travel between two end points (source and destination city-pairs) in the network. Latency affects one's perception of the response time of the network. It is difficult to estimate the latency because of the irregular congestion and routings there are with the different networks.

Question 18 - Time to live in IP header
'''18. What is the time-to-live field in the IP header used for? What happens if the internet becomes “too big” for this field? '''

It is the timeout time (delay time) it takes for one hop of the network. If a timeout occurs, then the packet is discarded and a timeout is sent back to the sender. This field used to contain hops, but now it contains actual time it takes.

Question 19 - Datagram Fragmentation
'''19. Why is datagram fragmentation sometimes necessary? How does IP fragment datagrams? '''

As a datagram moves from network to network it may be necessary for a router to divide the datagram into smaller pieces. This occurs if a gateway connects two networks that use different physical media, such as ethernet and a serial modem line. Each type of network has a maximum transmission unit (MTU) parameter that defines the largest packet it can transfer. If a datagram is larger than the MTU for the network then the IP module breaks the datagram into smaller parts. This process is called fragmentation.

In the following example, an IP datagram is fragmented into two. This same algorithm can be used to fragment the datagram into 'n' fragments.


 * 1. The IP layer creates two new IP datagrams, whose length satisfies the requirements of the network in which the original datagram is going to be sent.
 * 2. The IP header from the original IP datagram is copied to the two new datagrams.
 * 3. The data in the original IP datagram is divided into two on an 8 byte boundary. The number of 8 byte blocks in the first portion is called Number of Fragment Blocks (NFB).
 * 4. The first portion of the data is placed in the first new IP datagram.
 * 5. The length field in the first new IP datagram is set to the length of the first datagram.
 * 6. The fragment offset field in the first IP datagram is set to the value of that field in the original datagram.
 * 7. The "more fragments" field in the first IP datagram is set to one.
 * 8. The second portion of the data is placed in the second new IP datagram.
 * 9. The length field in the second new IP datagram is set to the length of the second datagram.
 * 10. The "more fragments" field in the second IP datagram is set to the same value as the original IP datagram.
 * 11. The fragment offset field in the second IP datagram is set to the value of that field in the original datagram plus NFB.

Question 20 - IP Header Checksum
'''20. What is included in the IP header checksum? Why isn't more of the packet included? '''

Only the header of the message is computed on the checksum. This is done to streamline the message transfer. (?)

A checksum is a simple error-detection scheme in which each transmitted message that results in a numerical value based on the value of the bytes in a message. The sender places the calculated value in the message (usually in the message header) and sends the value with the message. The receiver applies the same formula to each received message and checks to make sure the accompanying numerical value is the same. If not, the receiver can assume that the message has been corrupted in transmission.

Question 21 - IP Options
'''21. What are the IP options? Why is their use problematic in today’s Internet?'''

Several options, such as Record Route and Timestamp, contain slots into which a router inserts its address when forwarding the packet. However, each such option has a finite number of slots, and therefore a router may find that there is not free slot into which it can insert its address. No requirement listed below should be construed as requiring a router to insert its address into an option that has no remaining slot to insert it into. Section [5.2.5] discusses how a router must choose which of its addresses to insert into an option.

- QUIZ #6 -

=Review #6: UDP & TCP=

Question 1 - Difference between UDP and TCP
'''1. What is the difference between UDP and TCP service over the internet? '''

Question 2 - UDP and TCP service over internet
'''2. Why are both UDP and TCP service provided by the internet? '''

Question 3 - UDP packet checksum
'''3. Explain in your own words how UDP computes packet checksums. '''

Question 4 - UDP packet checksum
'''4. Since IP uses checksums, why does UDP use checksums also? '''

Question 5 - Protocol port
'''5. What is a protocol port? How is it used? '''

Question 6 - UDP port number
'''6. Is UDP port number 4555 the same as TCP port number 4555? '''

Question 7 - UDP pseudoheader checksum
'''7. How are pseudoheaders used to compute UDP and TCP checksums? '''

Question 8 - Pseudoheaders
'''8. Are the pseudoheaders sent with UDP or TCP packets? '''

Question 9 - UDP, TCP checksum calculation
'''9. How does the UDP/TCP receiver recompute the data checksum? '''

Question 10 - TCP transmission
'''10. Does TCP support transmission of structured data? Does TCP allow transmission of structured data? '''

Question 11 - TCP connection
'''11. How does TCP define a connection? '''

Question 12 - TCP port sharing
'''12. Under what circumstances can processes on a single machine share a TCP port? '''

Question 13 - TCP push oprtion
'''13. What is the purpose of the push option in TCP? '''

Question 14 - space advertisement with TCP acknowledgement
'''14. What is the purpose of the space advertisement sent with each TCP acknowledgment? '''

Question 15 - TCP acknowledgment lost
'''15. If a TCP acknowledgment is lost, is the data packet always transmitted? '''

Question 16 - TCP timeout
'''16. When a TCP timeout is sent, which packets are resent? Are all of these packets always resent? Explain your answer. '''

Question 17 - Flow Control
'''17. What does flow control prevent? How is flow control provided by TCP? '''

Question 18 - Urgent Data, TCP
'''18. What is the purpose of urgent data? How does TCP support this? '''

Question 19 - Timeout values
19. What are some of the difficulties with setting timeout values for TCP?

Question 20 - ALPHA and sensitivity
'''20. Explain how the value of ALPHA determines sensitivity to change in the following formula: RTT = (ALPHA * OLD_RTT) + (1 - ALPHA) * NEW_RTT. '''

Question 21 - BETA and retransmissions
21. Explain how the value of BETA affects the number of unnecessary retransmissions in the following formula:  Timeout = BETA * RTT 

Question 22 - Estimates
'''22. What is the problem with using estimates of round trip delay based on acknowledgments for retransmitted packets? '''

Question 23 - Exponential timer backoff
'''23. What is exponential timer backoff? What is it used for? '''

Question 24 - variability in TCP
'''24. How is variability in round trip times handled in TCP? '''

- QUIZ #7 -

Question 25 - congestion
'''25. What is congestion? How does TCP handle possible congestion? '''

Question 26 - handshaking in TCP
'''26. Why is handshaking necessary when TCP connections are initiated or terminated? '''