Unit1-Part1
Unit1-Part1
Unit1-Part1
1. Physical Layer:
- The physical layer co-ordinates the function required to carry a bit stream
over a physical medium.
- Characteristics of Physical layer:
1. Physical characteristics of interface and medium.
2. Representation of bits.
3. Data rate
4. Synchronization of bits.
5. Line configuration.
6. Physical topology.
7. Transmission mode.
2. Data Link Layer:
- Data link layer transforms the physical layer,a raw transmission facility, to
a reliable link.
- Characteristics of Data Link Layer:
1. Framing.
2. Physical addressing.
3. Flow control.
4. Access control.
5. Error control.
3. Network Layer:
- Network layer is responsible for source-to-destination delivery of packet
possibly across multiple network.
- Characteristics of Network Layer:
1. Logical addressing.
2. Routing.
4. Transport Layer:
- Transport layer is responsible for the delivery of message from one process
to another.
- Characteristics of Transport layer:
1. Service point addressing.
2. Segmentation and reassembly.
3. Connection control.
4. Flow control.
5. Error control
5. Session Layer:
- Session layer establishes, maintains and synchronizes interaction between
communication system.
- Characteristics of Session layer:
1. Dialog control.
2. Synchronization.
6. Presentation Layer:
- Characteristics of Presentation layer:
1. Translation.
2. Encryption.
3. Compression.
7. Application Layer:
- Application layer is responsible for providing services to the user.
- Characteristics of Application layer:
1. Network Virtual Terminal.
2. File transfer, access and management.
3. Mail service.
4. Directory service.
2. TCP/IP Protocol Suite:
• Physical and Data Link Layer:
At physical and data link layer, TCP/IP does not define any specific
protocol. It supports all standards and proprietary protocol.
• Network Layer:
At network layer TCP/IP supports Internetworking Protocol(IP).
IP in turn supports 4 protocol: ARP, RARP, ICMP and IGMP.
1. Internetworking Protocol (IP):
-It is unreliable and connectionless protocol, also known as best effort
service.
-It does not provide error checking or tracking.
-It transports data in form of packets known as datagrams, each
transported separately.
2. Address Resolution Protocol(ARP):
- It is used to associate logical address to physical address.
3. Reverse Address Resolution Protocol(RARP):
- It is used to find logical address when its physical address is known.
4. Internet Control Message Protocol(ICMP):
- It sends query and error reporting messages back to the sender.
5. Internet Group Message Protocol(IGMP):
- It is used to transmit messages to group of recipients.
• Transport Layer:
- Transport layer was represented in TCP/IP by two protocols: TCP and
UDP.
- TCP and UDP are transport level protocol responsible for process to
process delivery of message.
- SCTP protocol was introduce to meet requirements of some newer
application.
1. User Defined Protocol (UDP):
-It is a process to process protocol that adds only port no. , checksum
error control and length of information that comes from upper layer.
2. Transmission Control Protocol(TCP):
-It is a reliable, connection oriented protocol.
-It divides stream of data into smaller units known as segments.
3. Stream Control Transmission Protocol(SCTP):
-Provides support to newer application such as voice over internet.
• Application Layer:
-It is combination of session, presentation and application layer.
IPv4
• Addresses:
- IPv4 address is a 32-bit number.
- It is unique and universal.
- They are unique in the sense that each address defines one
and only one connection to internet. Two devices on
internet can never have same address at the same time.
Address are assigned to a device for a period of time and
then taken away and assigned to another device.
- They are universal in the sense that the addressing system
must be accepted by any host that wants to be connected
to the Internet.
• Address Space:
- IPv4 that defines addresses has an address space.
- An address space is the total number of address used
by the protocol.
• Notation:
1. Binary Notation:
- It is a 32 bit number that is represented in 4 different
octet.
- E.g. 01110101 10010101 00011101 00000010
2. Dotted-Decimal Notation:
- It is written in decimal form with a decimal point
(dot) separating the bytes.
- E.g. 117.149.29.2
• Classful Addressing:
- IPv4 addressing used the concept of classes. This
architecture is called classful addressing.
- In classful addressing the address space is divided
into five classes A,B,C,D and E. Each occupies some
part of address space.
▪ Classes and Blocks:
- In classful addressing each class is divided into a
fixed number of blocks with each block having fixed
size.
▪ Netid and Hostid:
- In classful addressing an IP address in class A,B and C is divided into netid
and hostid.
- In class A one byte defines the netid and three byte defines the hostid.
- In class B two byte defines the netid and two byte defines the hostid.
- In class C three byte defines the netid and one byte defines the hostid.
▪ Mask:
- It is a 32-bit number made of contiguous 1s followed by contiguous 0s.
Also known as default mask.
- It is used to find netid and hostid.
- Mask is represented in form of /n and this notation is called as Classless
Interdomain Routing (CIDR).
▪ Subnetting:
- Large blocks of class A and B was divided into
several contiguous group and assign each
group to smaller network called subnet.
▪ Supernetting:
- In supernetting an organization can combine
several class C block to create a large range of
addreses. Several network are combined to
create a super network or supernet.
• Classless Addressing:
- In this there are no classes, but the addresses still granted in
blocks.
- In this scheme block (range) of addresses was granted. The
size of block varies based on the nature and size of entity.
- Restriction:
1. The address in a block must be contiguous one after
another.
2. The number of addresses in a block must be a power of 2.
3. The first address must be evenly divisible by number of
addresses.
▪ Mask:
- It is a 32-bit number in which n leftmost bits are 1s and 32-n
rightmost bits are 0s.
▪ First Address:
- First address is found by setting 32-n rightmost bits in binary
notation of address to 0s.
▪ Last Address:
- Last address is found by setting 32-n rightmost bits in binary
notation of address to 1s.
▪ Number of Addresses:
- Number of addresses in the block is the difference between the
last and first address.
▪ Network Addresses:
- The first address is called the network address and defines the
organization network. It defines the organization itself to the
rest of the world.
• Datagram:
- Packets in IPv4 are called datagrams.
▪ Version (VER)- This is 4-bit field defines the version
of the IPv4 protocol. All fields must be interpreted as
specified in the fourth version of the protocol.
▪ Header Length(HLEN)- This is a 4-bit field defines
the total length of the datagram header.
▪ Services- Previously called service type and now is
called differentiated service.
- Service Type:
• The first 3 bit are precedence bits ranging from
0(000) to 7(111).
It defines the priority of the datagram in issues of
congestion.
• The next 4-bit are called TOS (Type of Service).
- D: Minimum Delay
- T: Maximum Throughput
- R: Maximum Reliability
- C: Minimum Cost
• The last bit is never used.
- Differentiated Service:
• The first 6 bits make up codepoint and last 2 bits are
not used.
• When 3 rightmost bit are 0s, the leftmost bits are
interpreted the same as precedence bits.
• When the 3 rightmost bits are not all 0s, the 6 bits
defines services based on the priority assigned by the
Internet.
▪ Total Length: It is a 16-bit field that defines the total
length of IPv4 datagram in bytes.
Length of data= total length – header length
▪ Identification: It is a 16 bit field used in
fragmentation. All the fragments have same
identification number. The identification number
helps the destination in reassembling the datagram.
▪ Flags: D- means do not fragment.
M- more fragments.
3. Implicit Signaling:-
- In this, there is no communication between the congested
node or nodes and the source. The source guesses that
there is a congestion somewhere in the network from other
symptoms.
4. Explicit Signaling:-
- The node that experiences congestion can explicitly send a signal to the
source or destination.
- It is different from choke packet.
- Unlike choke packet where separate packet is used to send this signal, in
this method signal is included in the packet that carry data.
5. Backward Signaling:-
- A bit can be set in a packet moving in the direction opposite to the
congestion. This bit can warn the source that there is congestion and
that it needs to slow down to avoid the discarding of packets.
6. Forward Signaling:-
- A bit can be set in a packet moving in the direction to the congestion.
This bit can warn the destination that there is congestion. The receiver in
this case can use policy such as slowing down the acknowledement
❑ Congestion control in TCP:
1. Congestion Window:
- The sender window size is determined by the
available buffer space in the receiver (rwnd).
- If the network cannot deliver the data as fast as
they are created by the sender, it must tell the
sender to slow down.
- In other words, in addition to the receiver the
network is a second entity that determine that
size of the sender’s window.
2. Congestion policy:-
- TCP’s general policy for handling congestion is based on
three phases: slow start, congestion avoidance and
congestion detection.
-> Slow Start: Exponential Increase:
- This algorithm is based on the idea that the size of the
congestion window (cwnd) starts with one maximum
segment size (MSS).
- The MSS is determined during connection establishment.
- The size of the window increases one MSS each time
acknowledgement is received.
- The window starts slowly, but grows exponentially.
- Slow start cannot continue indefinitely. There must
be a threshold to stop this phase.
- The sender keeps track of a variable name ssthresh.
- When the size of window reaches this threshold,
slow start stops and the next phase starts.
-> Congestion Avoidance: Additive Increase:-
- TCP defines algo called congestion avoidance,
which undergoes an additive increase instead of
exponential one.
- When the size of the congestion window reaches
the slow-start threshold, the slow start phase
stops and additive phase begins.
- In this each time the whole window of segment is
acknowledged the size of the congestion window
is increased by 1.
-> Congestion Detection: Multiplicative Decrease:-
- Retransmission can occur in two cases- when a timer times out or when
three ACK’s are received. In both case the size of the threshold is dropped
to one-half, a multiplicative decreases.
- TCP implementation have two reactions:
1. If a time-out there is possibility of congestion; a segment has been
dropped in the network and there is no news about the sent segment.
a. TCP sets the value of threshold to one-half of the current window size.
b. It sets cwnd to the size of one segment.
c. It starts the slow-down phase again.
2. If three ACK’s are received there is a congestion; a segment has been
dropped. This is called fast transmission and fast recovery.
a. TCP sets the value of threshold to one-half of the current window size.
b. It sets cwnd to the value of the threshold.
c. It starts the congestion avoidance phase.
• Quality Of Service
1. Reliability:
- It is a characteristic that a flow needs.
- Lack of reliability means losing packet or
acknowledgement which is entails retransmission.
2. Delay.
3. Jitter:
- Jitter is the variation in delay for packets belonging to
the same flow.
4. Bandwidth:
- Different application need different bandwidths.
Application Layer
• Remote Logging:
- Users may want to run application program at a
remote site and create results that can be transferred
to their local site.
- Eg: Students at university.
- A general-purpose client/server program lets a user
access any application program on a remote
computer; in other words, allow the user to log on to a
remote computer.
- After logging on, a user can use the services available
on the remote computer and transfer the result back
to the local computer.
• TELNET (TErminal NETwork):
- It is a general purpose client/server
application program.
- It operates in a timesharing environment.
Logging:
- Two types of log-in: local and remote.
a. Local log-in:
- When a user logs into a local timesharing system,
it is called local log-in.
- As a user types at a terminal or at a workstation
running a terminal emulator, the keystrokes are
accepted by a terminal driver.
- The terminal driver passes the character to the
operating system.
- The operating system, in turn, interprets the
combination of character and invokes the desired
application program or utility.
b. Remote log-in:
- When a user wants to access an application program or utility located on a
remote machine, it performs remote log-in.
- User sends keystroke to terminal driver, local operating system accepts
character but does not interpret.
- The character are send to the TELNET client, which transforms the
character to a universal character set called network virtual terminal (NVT)
and delivers them to the local TCP/IP protocol stack.
- NVT travel through Internet and arrive at the TCP/IP stack at the remote
machine.
- Then it is delivered to the operating system and passed to the TELNET
server, which changes the character to the corresponding character
understandable by the remote computer.
- However the character cannot be passed directly to the operating system
because the remote operating system is not designed to receive
characters from TELNET server. It receives from terminal driver.
- A pseudorandom driver is a piece of software that accepts the character
from TELNET server, which pretends that the character are coming from a
terminal.
- The operating system then passes the character to the appropriate
application program.
Network Virtual Terminal:
- We are dealing with a heterogeneous systems, if we want
to access any remote computer, we must know what type
of computer we will be connected to, and we must also
install the specific terminal emulator used by that
computer.
- TELNET defines a universal interface called the network
virtual terminal (NVT) character set.
- Via this interface, the client TELNET translates character
that come from the local terminal into NVT from and
delivers them to the network.
- The server TELNET translates data and command from NVT
form into the form acceptable by the remote computer.
• Electronic Mail:
Architecture:
- There are four scenarios:
i. First Scenario:
- Sender and receiver of email are user on the same
system; they are directly connected to a shared
system.
- Administrator has created one mailbox for each
user where received message are stored with
permission restriction.
- When sender wants to send message, User Agent
(UA) program prepare the message and store it to
receiver mailbox.
- Receiver can retrieve and read the content of his
mailbox at his convenience using UA.
ii. Second Scenario:
- The sender and the receiver of the email are user on two different
systems.
- Message needs to be sent on the internet.
- Host A need UA to send message to system at her own site.
- System at her site uses a queue to store message waiting to be sent.
- Host B need UA to retrieve message stored in mailbox to system site.
- Here two message transfer agents (MTA) are needed: one client and one
server.
iii. Third Scenario:
- Here receiver may be directly connected to his system but sender is
seperated from her system.
- It may be connected either by LAN or WAN connection
- For this we require two pair of MTA client/server program.
iv. Fourth Scenario:
- Here both sender and receiver are connected to their mail server by a
WAN or LAN.
- After the message arrives at receiver, to retrieve message, a client/server
agent is needed called message access agent (MAA).
User Agent:
i. Services provided by User Agent:
a. Composing message – creating message.
b. Reading message – to read incoming message. It
shows one line summary; a number field, flag that
shows the status (new, already read, read and replied
etc.), size of message, sender, and optional subject
field.
c. Replying to message.
d. Forwarding message.
e. Handling Mailbox – Inbox and Outbox.
ii. Types of User Agent:
a. Command Driven
b. GUI based.
iii. Sending Mail:
- It has an envelope and a message.
- Envelope contains the sender and receiver address.
- Message contains header and body.
- Header defines the sender, receiver and subject.
- Body defines actual information.
iv. Receiving Mail:
- UA informs the user with a notice.
- If a user is ready to read the mail, a list is
displayed in which each line contains
summary of the information about a particular
message in the mailbox.
v. Addresses:
- Consist of two parts local and domain
seperated by @ sign.
MIME (Multipurpose Internet Mail Extension):
- Email can send message only in NVT 7-bit ASCII format.
- It has some limitation i.e. it cannot be used for languages that are not
supported by 7-bit ASCII character.
- MIME is a supplementary protocol that allows non-ASCII data to be send
through email.
- MIME transforms non ASCII data to NVT ASCII data and delivers them to
the client MTA to be sent through the Internet.
- The message at the receiving side is transformed back to the original data.
- MIME as a set of software functions that transforms non-ASCII data to
ASCII data and vice versa
- MIME defines five headers that can be added to the original email header
section.
i. MIME-Version
ii. Content-Type : type of data.
iii. Content-Transfer-Encoding : method used to encode the message into
0s and 1s
iv. Content-Id : unique identification of message in multiple message
environment
v. Content-Description : defines message is image, audio or video.
Message Transfer Agent (MTA):
- To send mail, a system must have client MTA, and to receive mail, a
system must have server MTA.
- The formal protocol that defines the MTA client and server in Internet is
called Simple Mail Transfer Protocol (SMTP).
- SMTP defines how command and responses must be sent back and forth.
- SMTP is used two times, between the sender and the sender’s mail server
and between the two mail servers.
Mail Transfer Phases:
- The process of transferring a mail message
occurs in three phases: connection
establishment, mail transfer and connection
termination.
Message Access Agent: POP & IMAP:
i. Post Office Protocol, Version 3 (POP3):
- It is simple with limited functionality.
- Software is installed both at client and server side.
- Mail access starts with client when user needs to download email from mailbox on
mail server.
- Client opens a connection to the server on TCP port 110.
- It then sends its user name and password to access mailbox.
- The user can then list and retrieve the mail message.
- It has two modes : delete and keep.
delete: mail is deleted from mailbox after each retrieval.
keep : mail remains in mailbox after retrieval.
ii. IMAP4 – Internet Mail Access Protocol, version
4:
- It has more features than POP3.
- Extra features:
i. user can check email header prior to
downloading.
ii. User can search content of email for specific
string of character prior to downloading.
iii. Add, delete or remove mailboxes on mail server.
iv. A user can create hierarchy of mailboxes.
• File Transfer Protocol (FTP):
- It is provided by TCP/IP for copying file from one host to another.
- It needs two TCP connection.
- The well known port 21 is used for control connection and well known
port 20 for data communication.
- Control connection remains connected during entire interactive FTP
session.
- Data connection is opened and then closed for each file transferred.
- It uses 7-bit ASCII character.
- Communication is achieved through command and responses.
Domain Name System
- The client/server programs can be divided into two
categories: those that can be directly used by the user,
and those that support other application programs.
- The Domain Name System (DNS) is a supporting
program that is used by other programs.
- Example:
- DNS client/server program can support an e-mail program to
find the IP address of an e-mail recipient.
- A user of an e-mail program may know the e-mail address of
recipient; however, the IP protocol needs the IP address. The
DNS client program sends a request to a DNS server to map
the e-mail address to corresponding IP address.
• Name Space:
- The names assigned to a machine must be carefully
selected from a name space with complete control
over the binding between the names and IP addresses.
- The name must be unique because address are unique.
Unique names can be organized in two ways: flat or
hierarchical.
▪ Flat Name Space:
- In this name is assigned to an address.
- A name in this space is a sequence of characters without
structure.
- Disadvantage: It cannot be used in large system because it
must be centrally controlled to avoid ambiguity and
duplication.
▪ Hierarchical Name Space:
- In this name is made up of several parts.
- The first part define nature of organization; second part
can define the name of organization; third part may define
the department and so on.
- The central authority to assign and control the name
spaces can be decentralized.
• Domain Name Space:
- To have hierarchical name space a domain name space was
designed.
- In this the name are defined in an inverted-tree structure with
root at the top.
- Tree can have 128 level; 0 (root) to 127(level).
▪ Label:
- Each node in the tree has a label which is a string with a maximum
of 63 characters.
- Each children node has a different name which guarantees the
uniqueness of the domain names.
▪ Domain Name:
- Each node in the tree has a domain name.
- A full domain name is a sequence of labels separated by dot (.)
-> Fully Qualified Domain Name: If a label is terminated by a null
string, it is called fully qualified domain name (FQDN).
e.g abc.pqr.xyz.edu.
-> Partially Qualified Domain Name: If a label is not terminated by a
null string, it is called partially qualified domain name (PQDN).
e.g. Abc
▪ Domain:
- A domain is a subtree of a domain name space.
• Distribution of Name Space:
- The information contained in the domain name space must be stored.
- It is inefficient and unreliable to store large amount of information on
single system.
▪ Hierarchy of Name Server:
- In this information is distributed among many computers called DNS
Server.
- Each server can be responsible for either a large or a small domain.
Hierarchy of server is similar as hierarchy of names
▪ Zone:
- Domain name hierarchy cannot be stored on a single server, it
is divided among many servers.
- What a server is responsible for or has authority over is zone.
Zone can be defined as contiguous part of entire tree.
- The server makes a database called zone file and keeps all the
information for every node under that domain.
▪ Root Server:
- It is a server whose zone consists of the whole tree.
- Root server does not store any information about domain but
delegates its authority to other server keeping references to
those servers.
▪ Primary and Secondary Servers:
- Primary server is a server that stores a file about the zone for
which it is an authority. It is responsible for creating,
maintaining, and updating the zone file on a local disk.
- Secondary server is a server that transfer the complete
information about a zone from another server and stores the
file on its local disk. It does not create or update the zone files.
• DNS in the Internet:
- In internet the domain space is divided into three sections:
generic domains, country domains, and inverse domain.
1. Generic Domain: It defines registered hosts according to
their behavior.
2. Country Domain: It uses two-character abbreviation.
Second label can be organizational, or national
designations.
3. Inverse Domain: It is used to map address to a name.
- When a server has received a request from client; although
the server has a file that contains a list of authorized clients,
only the IP address of the client is listed. The server asks its
resolver to send a query to the DNS server to map an
address to a name to determine if the client is on the
authorized list. This type of query is called an inverse or
pointer (PTR) query.
• Resolution:
- Mapping a name to an address or an address to a name
is called name-address resolution.
▪ Resolver:
- A host that needs to map an address to a name or a
name to an address calls a DNS client called a resolver.
- The resolver accesses the closest DNS server with a
mapping request.
- If the server has the information it satisfies the
resolver; otherwise it either refers the resolver to other
servers or ask other servers to provide the information.
- After the resolver receives the mapping, it interprets
the response to see if it is a resolution or an error and
finally delivers the result to the process that requested
it.
▪ Mapping Name to Addresses:
- The resolver gives a domain name to the server and
asks for the corresponding address.
- Server checks the generic domains or the country
domains to find the mapping.
▪ Mapping Addresses to Name:
- A client can send an IP address to a server to be
mapped to a domain name; this is called a PTR query.
To answer queries DNS uses the inverse domain.
▪ Recursive Resolution:
- The client can ask for a recursive answer from a name server.
This means that a resolver expects the server to supply the
final answer.
- If the parent is the authority it responds; otherwise, it sends the
query to another server.
- When query is finally resolved, the response travels back until
it finally reaches the requesting client. This is called recursive
resolution.
▪ Iterative Resolution:
- If the server is an authority for the name, it sends the answer,
or return the IP address of the server that it thinks can resolve
the query.
- The client must repeat the same query to multiple server and
so it is known as Iterative resolution.
▪ Caching:
- DNS handles mechanism called cashing.
- When a server asks for a mapping from another server and
receives the response, it stores this information in its cache
memory before sending it to the client.
- If the same or another client asks for the same mapping it can
check its cache memory and solve the problem.
• DNS Messages:
- DNS has two types of messages: query and response.
- The query message consists of a header and question
records; the response message consists of a header,
question records, answer records, authoritative
record, and additional records
• Header:
- Both query and response messages have same header format with some
fields set to zero for the query messages.
- Identification:- it is used by client to match the response with the query.
- Flags:-it is a collection of subfields that defines the type of message, the
type of answer requested, the type of desired resolution and so on.
- Number of question records:- It contains number of queries in the question
section of the message.
- Number of answer records:- It contains number of answer records in the
answer section of the response message.
- Number of authoritative records:- It contains the number of authoritative
records in the authoritative section of a response message.
- Number of additional records:- It contains the number additional records in
addition section of response message.
▪ Question Section:
- It contains one or more question records.
- It is present on both query and response.
▪ Answer Section:
- It consist of one or more resource records.
- It is present only on response messages.
▪ Authoritative Section:
- It consist of one or more resource records.
- It is present only on the response messages.
▪ Additional Information Section:
- It consist of one or more resource records.
- Provides additional information that may help the resolver.
• Types of Records:
1. Question Record:
- It is used by the client to get information from a server. This
contains the domain name.
2. Resource Record:
- Each domain name is associated with a record called the
resource record. The server database consists of resource
records. Resource records are also what is returned by the
server to the client.