Anda di halaman 1dari 39

Data Communications &

Network Principles
Lecture 3
Internet Protocols
20th October 2005

Aims & Learning Outcomes


Protocol
IP Addressing Scheme
Classes of IP addresses

Subnetting
Structure of a datagram
Fragmentation & reassembly

Protocol
A set of rules that govern data
communications
A protocol defines
What is communicated
How it is communicated
When it is communicated

Protocol ctd
Key functions:
Encapsulation
Fragmentation and reassembly
Connection control
Ordered delivery
Flow control
Error Control
Addressing
Multiplexing
Transmission services
4

Encapsulation
Data transferred in blocks called protocol data
units (PDU)
Each PDU contains not only data but also
control information
Occasionally, some PDUs consist solely of
control information and no data
Control Information:
Address
Error detecting code
Protocol code

Addition of control information to data:


encapsulation

Fragmentation and reassembly


Computer networks may only accept
blocks of data up to a certain size
Data in messages need to be broken up
into blocks of some smaller bounded size:
fragmentation
Segmented data transmitted from
transmitter to receiver
At receiver, segmented data must be
reassembled: reassembly
6

Connection control
Two modes of operation:
Connectionless data transfer
An entity transmits data to another in such a way
that each PDU is treated independently of all
prior PDUs
Connection-oriented data transfer
Connection to be established between the
entities
Three phases occur:
Connection establishment
Data Transfer
Connection Termination

Ordered delivery
PDUs may not always arrive in the order
in which they sent because they may
traverse different paths through the
network
In connection-oriented protocols, it is
generally required that PDU order be
maintained
Each PDU is given a unique number and
numbers are assigned sequentially
8

Flow control
Function performed by a receiving entity to
limit the amount or rate of data that is sent
by a transmitting entity
Simplest form of flow control: stop-andwait procedure
Each PDU must be acknowledged before the
next can be sent

Error Control
To guard against loss or damage of data and
control information
Typically implemented as two separate functions:
Error detection
Sender inserts an error-detecting code in the
transmitted PDU, which is a function of the other bits in
the PDU
Receiver checks the value of the code on the incoming
PDU
If an error is detected, the receiver discards the PDU
Retransmission
Upon failing to receive an acknowledgement to the PDU
in a reasonable time, the sender retransmits the PDU
10

Addressing
Covers a number of issues:
Addressing level
Entity is named e.g IP address
Addressing scope
Unique address for device interface on the
network
Connection identifiers
Concerned with connection-oriented networks
Addressing mode
Unicast: address refers to a single system or port
Multicast: intended for a specific subset of entities
Broadcast: intended for all entities within a domain
11

Multiplexing
Multiple data streams that are converted
into a single

12

Transmission services
Protocol may provide a variety of additional
services e.g.
Priority
Quality of service
Security

13

Addressing
Addresses and routing are necessary
mechanisms for delivery at the network
layer, from host to host
A need to uniquely identify each device on
the Internet to allow global communication
between all devices

14

IP address
Also known as Internet address
IP = Internet Protocol
Identifier used in the network layer of the
Internet model to identify each device
connected to the Internet
32-bit binary address that uniquely and
universally defines the connection of a
host or a router to the Internet
15

IP address ctd
IP addresses are unique and universal
Two common notations:
Binary notation
Displayed as 32 bits with one or more spaces
inserted between each octet (or byte) (= 8 bits)
Example:
01110101 10010101 00011101 11101010

Dotted-decimal notation

16

Classes of IP addresses
5 classes of IP addresses: classes A, B, C, D, E

17

Finding the address class (binary)

18

Finding the class in dotted-decimal

19

Types of addresses
Unicast
Addresses in classes A, B and C are for
unicast communication
Multicast
Addresses in class D are for multicast
communication
Reserved
Used for special purposes
20

IP address: two parts

An IP address is divided into two parts:


Netid: represents the network
Hostid: represents the host

21

Class A IP addresses
First bit = 0
Next 7 bits represent network
Number of possible networks = 27 2

Remaining 24 bits represent host


Number of possible hosts = 224 2

Very few class A networks are possible


Each class A network is huge
22

Class B IP addresses
First bit = 10
Next 14 bits represent network
Number of possible networks = 214

Remaining 16 bits represent host


Number of possible hosts = 216 2

Medium number of class B networks are


possible
Each class B network is mid-size
23

Class C IP addresses
First bit = 110
Next 21 bits represent network
Number of possible networks = 221

Remaining 8 bits represent host


Number of possible hosts = 28 2

Medium number of class C networks are


possible
Each class C network is mid-size
24

IP Addressing Scheme
A problem of address assignment
inefficiency
126 Class A networks each with 16 million
hosts
16,384 Class B networks each with 65,534
hosts
>2 million Class C networks each with 254
hosts
Many IP addresses are wasted

Need for more flexibility: Subnetting


25

Subnetting
Same network
IP address
subnet

subnet
router

router

subnet

subnet
router
26

Subnet Addressing
IP address
before
subnetting

Netid

Hostid

IP address
after
subnetting

Netid

Subnet id Hostid

Subnet mask (e.g.: 255.255.255.0)


Subnet
mask

11111111 11111111

11111111 00000000
27

Interpretation of Subnet Mask


Breakdown of subnet mask
1 Network or subnet
0 Host

28

Subnet Mask & Subnet Number


With subnetting, a host has
IP address
Subnet Mask
Subnet Number

All of them are 32 bits long


Relationship between the three of them:
IP address Subnet Mask = Subnet Number
29

Fragmentation & Reassembly


(FAR)
Transfer of user messages across networks /
subnets which support smaller packet sizes than
the user data
Two approaches
Intranet fragmentation
Reassembly takes place at every intermediate node
followed by fragmentation
Internet fragmentation
Reassembly does not take place at every
intermediate node; fragmentation may or may not
take place

30

FAR: general principles


IP in a host knows only the maximum
packet size associated with its local
network
IP in an intermediate node knows the
maximum packet size of all the networks
to which it is connected

31

Intranet Fragmentation

32

Intranet Fragmentation ctd


IP in source fragments the data according to the
maximum packet size of its network
Each fragment is prefixed with some header including
the source address and the destination address

IP initiates the sending of fragments


At each intermediate node, fragments are
reassembled into data unit
Then, it is re-fragmented into datagrams as
dictated by the maximum packet size of the next
network/subnet
33

Intranet fragmentation ctd


Procedure is repeated by each
intermediate node until the datagrams
reach the destination
At destination, IP in destination host
reassembles the datagrams into the data
unit

34

Internet Fragmentation

35

Internet fragmentation ctd


IP in source carries out fragmentation
based on the maximum packet size of its
local network
IP initiates the sending of the datagrams
At an intermediate node, IP does not
reassemble the data unit
If the next network / subnet can support
this size of datagram, it sends them
without fragmentation

36

Internet fragmentation ctd


IP in the intermediate node fragments the
datagrams only if the next network /
subnet is not able to support this size of
datagram
At destination, IP in destination host
reassembles the datagrams into the data
unit

37

Intranet v/s Internet fragmentation


Intranet
Each time, maximum
packet size of
network/subnet is
used Efficient use
of resources
Time wasted at each
intermediate node to
re-assemble the data
unit

Internet
Not always making
maximum use of the
capacity of the
network/subnet
No time wasted at
each intermediate
node to re-assemble
the data unit
38

Reading list
Stallings, W., (2004), Data and Computer
Communications, Pearson Prentice Hall,
7th Edition: Chapter 18

39

Anda mungkin juga menyukai