Network Types and Protocols Overview
Network Types and Protocols Overview
Overview
• A network is the interconnection of a set of devices capable of communication.
• Local Area Network: usually privately owned and connects some hosts in a single o ce,
building, or campus.
• Point-to-point WAN: a network that connects two communicating devices through a
transmission media.
• Switched WAN: a network with more than two ends.
• When two or more networks are connected they become internet.
• An internet is a switched network in which a switch connects at least two links together
• In a circuit switched network a dedicated connection, is always available between the two end
systems. Circuit switched network is e cient only when it is working at its full capacity.
• Packet switched network: obvious
• A router in a packet-switched network has a queue that can store and forward the packet.
• The Internet:
• At the top level, the backbones are large networks owned by - Sprint, Verizon (MCI), AT&T, and
NTT.
• Backbone networks are connect through some complex switching systems, called peering
points.
• Provider networks, use backbones for a fee.
• Together these are ISPs.
• Accessing the Internet:
• Using telephone networks:
• Dial-up service: modem that converts data to voice. slow and useful for small residences.
• DSL service: higher speed internet services
Protocol Layering
• A protocol de nes the rules that both the sender and receiver and all intermediate devices need
to follow to be able to communicate e ectively.
• Protocol layering enables us to divide a complex task into several smaller and simpler tasks.
• Protocol layering separates the services from the implementation
• Communication involves intermediate systems also, which can be just as complex as required.
• Dis: Single layer makes job easier (but does it?)
• Principles of protocol layering:
• First principle dictates that if we want bidirectional communication , we need to make each
layer so that it is able to perform two opposite tasks, one in each direction.
• Second principle is that two objects under each layer at both sites should be identical.
• TCP/IP protocol suite: Application, Transport, Network, Data link, Physical
• Application Layer: the logical connection, end-to-end, exchange messages, between two
processes.
• Transport Layer: end-to-end, logical connection, exchange packets (segment or datagrams).
SCTP (stream control transmission protocol)
• Network Layer: host-to-host communication and routing the packet through possible routes.
IP is a connectionless protocol that provides no ow control , no error control, and no
congestion control services. ex of protocols - Internet Control Message Protocol (ICMP),
Internet Group Management Protocol (IGMP)
• Data-link layer: routers in network layer decide best link, data link layer takes the datagram
across the link. Uses frames.
• Physical Layer: Logical connection, transmission medium are hidden layer, they use electric,
optic signals but physical layers assumes bits.
message -> segment(TCP)/ user datagram (UDP) -> datagrams -> frames.
Names -> port numbers -> logical addresses -> link layer addresses (MAC address) (no address
for physical)
fi
ff
ffi
fl
ffi
Multiplexing, Demultiplexing: Since TCP/IP protocol suite uses several protocols at some layers
we can say that we have multiplexing at the source and demultiplexing at the destination. To be
able to multiplex and demultiplex, a protocol needs to have a eld in its header to identify to
which protocol the encapsulated packets belong.
OSI Model:
International organisation for standardisations proposed Open Systems Interconnections (OSI)
model. An open system is a set of protocols that allows any two di erent systems to
communicate regardless of their underlying architecture.
OSI model has two extra layers -> Session and Presentation
The application layer in TCP/IP is considered combination of three layers
Two reasons for this:
• TCP/IP has more than one transport layer protocol, some of the functionalities of the session
layer are available in some of the transport layer protocols.
• The application layer is not only one piece of software. Many applications can be developed at
this layer if some of the functionalities mentioned in the session and presentation layers are
needed for a particular application, they can be included in the development of that piece of
software.
Reason for OSI fail:
• OSI was completed when TCP/IP was fully in place and a lot of time and money had been spent
on the suite.
• Some layers of the OSI model were not fully de ned. Presentation and session layers did not
have fully de ned protocols, and software wasn’t fully developed
• It did not show a high enough level of performance to entice the Internet Authority to switch
from the TCP/IP protocol suite to the OSI model.
Internet History
Read yourself
fi
Chapter 2: Application Layer
Introduction
• The application layer provides services to the user. The two application layers assume that there
is an imaginary direct logical connection (two - way).
• If a protocol is added to each layer, it should be designed in such a way that it uses the service
provided by one of the protocols at the lower layer.
• The protocols used in the rst four layers of the TCP/IP suite need to be standardised and
documented. Application layer protocols can be standard or non standard.
• Paradigm of application-layer:
• Client-server paradigm: a.k.a traditional paradigm. The concentration of the communication
load is on the shoulder of the server, this means there should be a service provider willing to
accept the cost and create a powerful sever for a speci c service which means server should
earn money.
• Peer-to-peer paradigm: a.k.a new paradigm. for e.g internet telephony. The main challenge is
security. The other challenge is applicability, this does not have many use cases.
• Mixed paradigm
Electronic Mail:
• E-mail is considered one-way transaction.
• Architecture: The electronic mail systems needs two UAs (user agent), two pairs of MTAs (mail
transfer agent) (client and server) and a pair of MAAs (Mail access agent)(client and server).
• User Agent: A user agent is a software package (program) that composes, read, replies to, and
forwards messages. It also handles local mailboxes on the user computers. They can be
command-driven or GUI-based. like Outlook.
• Sending mail: It has envelope and message, envelope contains sender address and receiver
address. The message contains header and body, header has sender, receiver, the subject of
the message.
• Receiving mail: Basically they explain what outlook looks like.
• Address: local part ‘@‘ domain name
• The domain name assigned to each mail exchanger either comes from the DNS database or is
a logical name (for example, the name of the organisation)
• Mailing list or group list: Aliases in the alias database.
• SMTP: SMTP is used two times, between the sender and the sender’s mail server and between
the two mail servers
• Command and responses: terminated by a two-character (carriage return and line feed) end-
of-line token.
• Commands: Keyword followed by argument
• Responses: three digit code followed by additional description
• Mail transfer phases:
• Connection Establishment: Port 25, client makes TCP connection. Server sends code 220
(service ready), else 421 (service not available). The client send the HELO message to
identify itself using its domain name address. The server responds with 250 (request
command completed).
• Message transfer: client sends MAIL FROM (to introduce sender, and for receiving error) ->
server responds with 250 -> client sends RCPT TO (recipient) -> server responds with 250
-> client sends DATA -> server responds with 354 (start mail input). -> client sends data line
by line and nished with end-of-line token.->server 250.
• Connection Termination: client QUIT -> server 221
• SMTP is a push protocol, third stage is a pull protocol, third stage uses message access agent.
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
• POP3 (post o ce protocol): Simple but limited, Opens connection to server on port 110 (TCP),
then sends username and password, on OK retrieves all mail one by one.
• POP3 has two modes, delete mode and keep mode. In the delete mode, the mail is deleted
from the mailbox after each retrieval, in the keep mode the mail remains in the mailbox after
retrieval. The delete mode is used when the user is working on their permanent computer, the
keep mode is used when the mail is accessed from multiple computers.
• IMAP4: Internet Mail access protocol version 4. IMAP4 is more powerful and more complex.
• POP3 does not allow the user to organise the mail on the server, have di erent folders, partially
check contents of mail before downloading. IMAP4 adds these features.
MIME: Multipurpose Internet Mail Extensions is a supplementary protocol that allows non-ASCII
data to be sent through e-mail, increasing language support. Electronic mail can only send
messages in NVT 7-bit ASCII format. MIME transforms non-ASCII data at the sender site to NVT
ASCII data and delivers it to the client MTA to be sent through the internet. The message ate the
receiving is transformed back to the original data. MIME de nes 5 headers
• MIME-version: current version is 1.1
• Content-type: type/subtype types include text, image, video, audio, application etc.
• Content-transfer-encoding: method used to endow the messages including binary, 8-bit, 7-bit
etc.
• Base64: write down 8bit representation break into 6 bits and write ASCII representation
• Quoted-printable: write the non-ASCII with equal to and follow base64 for only that.
• Content-ID identi es the whole message in a multiple message environment
• Content Description: de nes the body
Web based mail: websites today provide this service to anyone for ex - GMAIL.
In this instead of IMAP4 and POP3, HTTP is used. Client can also use HTTP client.
Email security: secured using two application layer protocols: Pretty Good Privacy (PGP) and
Secure/Multipurpose Internet Mail Extensions (S/MIME).
TELNET:
Telnet (TErminaL NETwork) and SSH are remote logging applications.
Local login, Remote login, pseudo terminal driver.
Network Virtual Terminal Character set (used because terminal commands di er based on OS). 8-
bit system with MSB set 0 for ASCII and 1 for control characters
Options are extra features available to a user with a more sophisticated terminal.
User Interface with user-friendly commands
Security of DNS:
DNS Security (DNSSEC) provides message origin authentication and message integrity using
digital signature. Doesn’t provide con dentiality for the DNS messages and no protection against
DOS attacks, caching system protects upper level servers against this attack to some extent.
Peer-to-peer paradigm
Centralised networks:
Listing of the peers and what they o er uses client-server paradigm, but the storing and
downloading of the les are done using the peer-to-peer paradigm.
Makes the maintenance of the directory simple, accessing the directory can generate huge tra c,
and if central directory is attacked entire system fails.
Decentralised networks:
peers arrange themselves into an overlay network, which is a logical network made on top of the
physical network.
Unstructured: In the name, ine cient as query must go through entire network. Eg. Gnutella and
Freenet.
Gnutella: ooding is somehow controlled to prevent huge tra c loads, one of the reasons that
Gnutella can not be scaled well it the ooding. A node needs to know the address of at least one
neighbour, this is done at the bootstrap time, when the node install the Gnutella software for the
rst time. The software includes a list of nodes that can record as neighbours. Later ping and
pong are used.
Newer version uses tiered system, of ultra nodes and leaves to make more e cient, also adds
Query Routing Protocol (QRP), Dynamic Querying (DQ) to reduce tra c overhead and make
searches more e cient.
Structured: prede ned set of rules to link nodes. Most common technique: Distributed Hash
table (used by BitTorrent) (DHT).
DHT is used in distributed data structure (DDS), Content Distributed Systems (CDS), Domain
Name Systems (DNS) and P2P le sharing.
fl
fi
fl
ffi
fi
fi
fi
fi
fi
ffi
ffi
fi
ff
fi
fl
fi
ffi
fi
ffi
ffi
ffi
Chapter 3
Transport-Layer Services
Process-to-process Communication: The rst duty of a transport-layer protocol. Process-to-
process means not only getting from source to destination computer but also to the correct pro
cess.
Addressing: Port Numbers: port number between 0-65535 (16-bits). Ephemeral port number has
to be greater than 1023.
ICANN Ranges:
• well-known: ports ranging from 0 to 1023
• registered ports: 1024 - 49151
• dynamic-private: 49152-65535
IP address + Port address = Socket address
The packets at the transport layers in the Internet are called user datagrams, segments, or
packets.
Multiplexing: When an entity accepts items from more than one source
Demultiplexing: vice versa.
Multiple messages form multiple packets (multiplexer) these packets go to multiple destinations
where they are extracted and sent to respective processed (demultiplexer)
Pushing: If the sender delivers items whenever they are produced without a prior request from the
consumer
Pulling: If the producer delivers the items after the consumer has requested them
When the producer pushes the items, the consumer may be overwhelmed and there is a need for
ow control.
E ciency: The stop and wait protocol is very ine cient if our channel is thick and long.
Round trip delay is long + large bandwidth -> bandwidth delay product.
No pipelining in stop and wait
Go-Back-N Protocol
(GBN):
We can send several
packets before receiving
acknowledgments, but
the receiver can only
bu er one packet.
Send window: an
imaginary box covering
the sequence numbers of
the data packets that can
be in transit or can be
sent.
Receive window: makes
sure that the correct data
packets are received and
that the correct
acknowledgments are
sent. In GBN the size of
this window is 1.
ffi
ff
ffi
fl
fl
Selective Repeat Protocol:
Simpli es process at the receiver as it keeps track of only one variable. Two windows, the
maximum size of the send window is 2^m-1. The size of the receive window is the same.
Acknowledgment is about sequence received.
Why window size is at most half? This you can read from book, good explanation.
Piggybacking: in two way connections, one direction data is sent with the acknowledgment for
other direction.
UDP Applications:
• Connectionless service: connectionless service is better if requests and response are short,
delay is an important issue. DNS uses UDP, SMTP cannot use UDP
• Lack of error control: good where uneven delay is not good but some information lost is ne.
Good for video calls, bad for pdfs
• Lack of congestion control: does not create extra tra c in error-prone network.
• UDP is also used with internal ow and error control mechanisms.