What is coding?
Coding is the mapping of information to symbols.
What is the name of the devices that are connecting these links?
The name of the devices that are connecting these links together in a network are called
either switches or routers, depending on the type of the network.
What is the purpose of Network Protocols and where are they layered?
Network Protocols give meaning to the messages that are exchanged and they are
layered on the top.
Lecture 2: Protocols and Layers
Physical Level:
It defines the characteristics of the cable/optical fibre or the properties of the wireless
link used.
(i.e. size/shape, maximum length and type for cables/optical fibres and radio frequency,
transmission power, modulation scheme and type of antenna for wireless links)
Network Layer:
It interconnects multiple links to form a Wide Area Network (WAN) from source host to
destination host. It is responsible for data delivery, naming and addressing, routing and
admission/flow control.
(Example: IP)
Transport Layer:
It transfers data between a session level service at the source and the corresponding
service at the destination (End-to-End Transfer). Amongst others, It provides reliability,
ordering, framing and congestion control.
(Example: TCP)
Session Layer:
It manages multiple transport layer connections.
(Examples: Use of TCP/IP connections to transfer a website using HTTP, Use of SMTP
to transfer several messages over a single TCP/IP connection)
Presentation Layer:
It manages the conversation, representation and presentation of data. It deals with the
character sets and languages, the data markup languages, the data format conversion
and the content negotiation.
Application Layer:
It deals with the User Application Protocols but not the application programs
themselves.
(Examples: Facebook API, Web Services, Grid Computing)
More complex signals -> Higher Frequency Component -> Greater Bandwidth
What is the use of producing a frequency domain view for a given channel?
Frequency Domain View lets us visualise the information content of a signal. Greater
amount of information leads to higher frequency components on the view.
How is the signal encoded into the channel in Wired Data Transmission?
The signal is encoded directly onto the channel in Wired Data Transmission. It usually
occupies a single baseband channel. The voltage in an electric cable and the intensity
of light in an optic fibre varies. Multiple digital coding schemes are used which have
different complexity and resilience to noise.
How is the signal encoded into the channel in Wireless Data Transmission?
Wireless links use Carrier Modulation rather than baseband transmission.
What are the factors that affect the performance of the signal encoding in
Wireless Data Transmission?
Carrier Frequency -> Affects the data rate and the propagation of the signal)
Transmission Power
Modulation Scheme
Type of Antenna
How can we handle the transmission of more than one bits per baud?
More complex modulation schemes allow more than one bits to be sent per baud.
These enable the use of multiple levels of the modulated component and the
combination of modulation schemes. Extremely complex combinations of schemes are
usually used.
How can we handle the prone to interference that single frequency channels
have?
This prone to interference that single frequency channels have can be mitigated by
repeatedly changing the carrier frequency for multiple times per second because the
noise is not very likely to affect all the frequencies. Each carrier frequency that is
selected for every specific time slot is chosen by using a pseudo-random sequence.
This process is kept as a secret between the sender and the receiver.
Lecture 5: The Data Link Layer
What is Framing?
Framing is a function provided by the Data Link Layer. It breaks the raw bit stream into
frames, transmits and repairs the individual frames and, finally, limits the scope of any
transmission errors.
List the different ways to detect the start of a message and state the
problems/benefits related with the use of each.
Leave gaps between the frames
Physical Layer cannot guarantee timing
Precede each frame with a length field
Length can be corrupted during the transmission
Add a special start code (= a unique bit pattern) at the start of each frame
Enables synchronisation after an error occurrence:
Wait for next start code
Begin reading frame headers
What is Sliding-Window?
Sliding-Window is a protocol that is a feature of packet-based data transmission
protocols. It assures that the delivery of packets is done, reliably, in the appropriate
order. Each portion of the transmission is assigned a unique consecutive sequence
number. These numbers are used by the receiver to place the received packets in the
correct order, discarding duplicate packets and identifying any missing ones. There is
no limit on the size of the sequence number that can be required.
What is Stop-And-Wait?
Stop-And-Wait is a method used to send information between two connected devices. It
is a special case of the Sliding-Window protocol. It ensures that no information is lost
during transmission due to dropped packets and that packets are received in the correct
order. A Stop-And-Wait request sends one frame at a time. After sending each frame,
the sender does not send any other frames until it receives an acknowledgement (ACK)
signal. After receiving a frame, the receiver sends an ACK. If the ACK is not received
before a certain time (timeout), the sender sends the same frame again.
Describe how Carrier Sense Multiple Access with Collision Detection (CSMA/CD)
works.
A version of the Carrier Sense Multiple Access (CSMA) but with Collision
Detection
Builds on the fact that the highest the propagation delay is, the collision rate is
increased
Listens to the channel before and while transmitting data:
If a collision occurs:
Packets are corrupted
Stops sending
Backs-off
Back-off Interval is random
Avoids deterministic redundant collisions
Should increase with the number of collisions that
affect a transmission:
Repeated collisions lead to signal congestion
Reducing the transmission rate will
allow the network to recover
Initial Back-off Interval:
x seconds 50%
Interval for each repeated collision before success:
2x seconds 50%
Back-off Interval is random
Retransmits
The time for which the channel is blocked due collisions is reduced
Better performance than the plain Carrier Sense Multiple Access (CSMA)
Poor Worst Case Performance due to the arbitrarily long delays and
unpredictable variation caused by the repeated collisions
It is cheap to be implemented
Hardware more readily available
Cannot guarantee real-time performance
List and explain the two different types of Slotted Media Access Control (MAC).
Time Division Media Access (TDMA) - Controls when hosts can transmit data
Frequency Slots - Controls which frequency bands hosts use to transmit data
Lecture 7: Bridging
List the drawbacks from the use of a single link as assumed by the Media Access
Control.
Limited scalability of a system
Vulnerable to cable damage
Vulnerable to disconnection
What is a hub?
A hub is a cable in a box with no intelligence. It is a physical layer interconnection of
links (equivalent to running a longer cable). It does not improve the scalability of a
network but it eases the physical interconnection of cables/devices. Damage to its
vulnerable cables disconnects only a single host rather than partitioning the whole
network. It is largely obsolete at the moment since it was replaced by data link layer
bridges.
What is a bridge?
A bridge is an intelligent device that understands and process data link layer frames,
identifies the location of hosts and forwards only the frames of interest. It also
understands the Media Access Control (MAC) protocol and joins multiple links together.
It needs zero configuration (Automation).
Example: Ethernet Switch
What is an internet?
An internet comprises a set of interconnected networks.
Each of these networks is an Autonomous System (AS)
They are administered separately by making independent policy
and technology choices.
A common end-to-end network protocol.
Provides a single seamless service to the Transport Layer
Delivers the data packets
Provisions circuits
Addresses the end systems
A set of gateway devices
Also known as Routers
Implements the common network protocol
Hides differences in the link-layer technologies
Framing
Addressing
Flow Control
Error Detection/Correction
Performs the least amount of translation necessary
List all the versions of the Internet Protocol (IP) that have been released.
IPv4 - The current production Internet
IPv5 - It was assigned to the Internet Stream Protocol
IPv6 - The next generation Internet
Which are the differences in the packets between the IPv4 and the IPv6 versions
of the Internet Protocol (IP)?
The IPv6 has:
A simpler header format
Larger addresses
Support for Fragmentation removed
Flow Label added
Which of the two versions (IPv4, IPv6) of the Internet Protocol (IP) should one
use?
IPv4 has reached the end of its life as a protocol
Insufficient Addresses available
IPv6 Is intended to be a long-term replacement for IPv4
Increase the number of the Address size
Allow more hosts to be added on the Network
Not clear if it is going to be widely deployed
Straightforward to build applications for both the protocols
getaddrinfo() will return the IPv6 address if it exists, otherwise it will
return the IPv4 address; all other socket calls will use the returned value
New code should support both
Lecture 9: Network Layer (2): Addressing
What are the issues that arise regarding the deployment of IPv6?
Changes to every single router, host, firewall and application are required
Host changes done in Windows, MacOS, iOS and on various Linux distributions
Backbone routers generally support IPv6
Most Home routers and Firewalls do not support IPv6 yet
Many applications have been updated accordingly
Make a comparison between the Distance Vector and the Link State methods for
Routing.
Doesnt require routers to store much Requires each router to store a complete
information Network Map
Slow Convergence makes Distance Vector method unsuitable for large Networks.
Lecture 11: Network Layer (3): Interdomain Routing
How does the Interdomain Routing between different Autonomous Systems (AS)
work?
An Autonomous System may belong to an Internet Service Provider (ISP) or
other organisation that operates a network and wants to participate
Some organisations may operate more than one Autonomous Systems
For ease of organisation
Due to company mergers
Each of this systems is independently administered
Every Autonomous System is identified by a unique number allocated by the
Regional Internet Registry (RIR).
Routing Problem is to find the best path between the source AS and the
destination AS.
Treat every AS as node on the Autonomous System Topology Graph
Treat the connections between these AS as edges in the graph
Interdomain routing is between competitors (network operators and companies
that compete for customers), so an AS is unlikely to trust its neighbours
Routing must consider policy
Restrictions on who can determine your topology
Restrictions on which route data can follow
Prefer control over routing (Due to personal preferences and oppositions,
political differences or cost)
What are the implications on the Network Architecture from the application of
Reliability functionalities?
Network Layer provides timely but unreliable service
Transport Layer adds the reliability, if it is necessary
Describe how Congestion and Flow Control work in the Transport Layer.
Transport Layer controls the application sending rate
To match the rate at which network layer can deliver data - Congestion
Control
To match the rate at which the receiving application can process the data -
Flow Control
This must be performed End-To-End, since only the endpoints know the
characteristics of the entire path
Different applications have different needs for Congestion Control
E-mail and File Transfer:
Elastic Applications: No concern about the sending rate
But still, faster is better
Voice or Streaming Video:
Inelastic Applications: Have minimum and maximum sending rates
Care about the actual sending rate
Large range of congestion control algorithms within the network constraints
needed
What is a Socket?
A Socket provides a standard interface between a Network and an Application.
It is independent of the Network type
Commonly used with TCP/IP and UDP/IP but not specific to the Internet
Protocol (IP)
What is a port?
A port is a 16 bit number used to distinguish servers.
Describe the process followed when setting up the Berkeley Sockets API.
1. Create a new Socket - Create a new unbound socket, not connected to a
network, to be used as either a server or a client
2. Specify an Address and Port
a. The address can be either IPv4 or IPv6
b. The address is specified via the struct sockaddr
i. Could be modelled in C as Union but it was, eventually, declared in
a number of structs to abuse casting.
ii. The sa_data field is big enough to hold the largest address of any
family
iii. The sa_len and sa_family specify the length and the type of the
address.
c. Treat the address as an opaque binary string.
d. Use either IPv4 or IPv6 addresses
i. To hold IPv4 addresses use struct sockaddr_in
ii. To hold IPv6 addresses use struct sockaddr_in6
These structs have the same size and memory layout as the struct
sockaddr but they interpret the bits differently to give structure to the
address
e. Cast the struct that it was selected to a struct sockaddr before calling the
socket routine
f. Create an Address
i. Either the default one using INADDR_ANY
ii. Or a specific IP Address using the inet_pton() method, if the
numeric IP is known
g. Convert port number using htons()
3. Implementing a Server
a. Bind to a port in a network interface
b. Listen for new connections on that port
i. The backlog is the maximum number of connections that the socket
will queue up in order for them to be accepted.
c. Accept new connections
i. Accept new connections in turn using a loop
ii. Create a new file descriptor connfd to be used for this connection
iii. The original fd remains open and can be used for another
connection
4. Implementing a Client
a. Connect to the server
i. The addr parameter includes the IP Address and the port on which
the server is listening
5. Writing Data
a. Use the write() call
i. Sends data over a socket
ii. Blocks until all data can be written
iii. Returns actual number of bytes written or -1, if an error occured
6. Reading Data
a. Use the read() call
i. Reads up to BUFLEN bytes of data from collection
ii. Blocks until there are data available to read
iii. Returns the actual number of bytes read or -1, if an error occured
iv. Data is not null terminated
Describe the process followed when setting up the User Datagram Protocol
(UDP).
1. Create a new Socket
a. Specify SOC_DGRAM as the socket type
2. Bind it to a known port
3. Send a datagram
a. Use sendto() call to send a single datagram
b. Each call to sendto() can send to a different address, despite the fact that
the same socket is still used
c. A call to the connect() method can be used to connect to an address
i. This call only sets the destination address for future packets, since
there is no connection made at the UDP layer.
ii. Then, use the write() call to send the data
4. Receive a datagram
a. The read() call may be used to read a single datagram
i. Does not provide the source address of the datagram
b. Use the recvfrom(), instead to fill in the source address of the received
datagram
There is no need to make connect() or accept() calls since there are no connections in
UDP.
Which are the two key principles for the Congestion Control?
The two key principles for the Congestion Control as which were first elucidated by Van
Jacobson in 1988 are:
Conservation of Packets
Additive Increase/Multiplicative Decrease in Sending Rate
These two principles together ensure the stability of the Network
Which are the limitations from the use of TCP related to the Congestion Control?
It assumes loss is only due to Congestion
Too much traffic is queued in an Intermediate link
Some packets are dropped
The above are not always true:
Wireless Networks
High-Speed, Long-Distance, Optical Networks
Much research is made into improved versions of TCP for wireless links
Lecture 16: Session Layer and DNS
Which are the Higher Layer protocols in the OSI Reference Model?
Session Layer
Presentation Layer
Application Layer
All of them are typically implemented within an application or a library and they have
poorly-defined boundaries between them.
How does the User and Resource Mobility work in the Session Layer?
IP Addresses encode location
Mobility breaks Transport Layer connections
Session Layer must find new location and establish bright new connections
The Old Location may be redirected
Users might register a new location
Update a DNS name to point to the new IP Address
Using an Application-Specific-Server
Which issues should be considered when one designs a binary coding scheme?
Must be backwards compatible with text-only systems
Some systems support 7-bit ASCII only
Some systems enforce a maximum line length
Data must survive from the translation between character sets
Must not use non-printing characters
Must avoid escape characters that might be interpreted differently by the channel
Escape characters might be used to convert 8-bit characters into a format
that is suitable for the channel, if the 8-bit values are rare
What is UT-8?
Variable-length coding of Unicode characters
Strongly recommended for the representation of data
Widely used in Internet Standard protocols
Backwards compatible with 7-bit ASCII characters
Codes in the ASCII character set can be encoded identically
All non-ASCII characters are coded with high bit set
No zero octets occur in UT-8
It can be represented as a string in C
For meaningful conversion, code the characters using UT-8 and specify the
language
The application-layer programmer need to worry about the manipulation of
data
How should the data be carefully validated before they are used?
Networked Applications, fundamentally, deal with data provided by un-trusted third
parties.
Data from the network may not conform to the protocol specification
Due to ignorance
Due to bugs
Due to malice and desire to disrupt services
Beware escape characters in user-supplied data
All user data should be sanitised before they are used
Stop malicious users from inserting control characters that
might disrupt the operation of any scripting language inside
the application
Therefore, all the data should be carefully validated before they are used by a system.