Sei sulla pagina 1di 51

Internet protocols

IP TCP UDP ICMP ARP RARP….


INTERNET PROTOCOL SUITE

Developed in mid 1970’s by Defence Advance


Research Project Agency(DARPA)

Objective : To establish a packet switched network

Providing Heterogeneous connectivity

Policies are specified in technical reports called


RFC’s(Request for comments)

IP is the heart of Internet Protocols providing connectio


nless,best-effort delivery of datagrams through an
internetwork; and providing fragmentation and
reassembly of datagrams

Q ? Connection vs Connection oriented


Connection vs connectionless
Connection oriented Connectionless oriented

virtual connection is created before sending the No virtual connection


packet over the internet. Service Primitives: UNIDATA,FACILITY,REPORT(performance
and link delivery statistics)
Service Primitives:
LISTEN,CONNECTION,RECEIVE,SEND
DISCONNECT
Authentication is needed before message delivery No authentication

Ensure delivery packet delivery from source to Unreliable


destination
Handshaking for data transfer Faster than connectionless as header size is small
Extra packet overhead
Connection vs connectionless
Connection oriented Connectionless oriented
Routing is finalized at the time of handshaking Routing is finalized based on the network congestion

Packets follow same path Packets delivered are out of order

Ex TCP Ex. IP ,UDP

Email for communication Applicable in developing video streaming website ( data should be
streamed without buffer delay)

DNS (Doman name server) uses service for IP resolution

What a TCP and IP actually do in Internet?


All the machines on the Internet—yours, mine, and everyone else's— are identified by an Internet Protocol (IP)
address.
IP is a routable protocol. Routers are used to implement the protocol,

DNS (Domain Name System) that enables a computer to look up the IP address for any given website

TCP that figures out how to get the data from the source to the destination
How Internet works

• All the machines on the Internet—yours, mine, and everyone else's— are identified by an Internet
Protocol (IP) address.
• IP is a routable protocol. Routers are used to implement the protocol.

• TCP that figures out how to get the data from the source to the destination
• End to End devices in Internet are called Hosts. Hosts on different networks requires routers for message
routing.
• Each packet is routed towards the destination based on its source and destination address.
• At each node, the router decides, based on calculations involving network statistics and costs, to which
neighboring node it is more efficient to send the packet.
• In summary, TCP is the data. IP is the Internet location GPS
IPv4 packet structure

IP datagram= Header+ Data


Ver : 4bit field IP version
4 identifies IPv4
6 identifies IPv6.
IP header is 20 bytes=5*32bit words.
.first three refers control info
And last two provide address infoh
IHL : how many four bytes are in
header.(Internet Header Length)
40 bytes
DSCP: Differentiated Services
Code Point; this is Type of Service.
ECN(Explicit Congestion Notification) It carries information about the congestion seen in the route.

Total Length: Length of entire IP Packet (including IP header and IP Payload).

Flags : first bit set to zero. 2nd bit DF (don’t fragment) set to 1,3rd bit MF(More fragment) set to 1

Fragment offset : Which fragment is being sent


IPv4 packet structure

Options : vary from 0 to 40 bytes


Header length varies from 20B + 0B to 20B to 40B.HL stores 5 for 20B and 15 in for 60B

Protocol: defines the protocol used in the data portion of the IP datagram. The Internet Assigned Numbers
Authority maintains a list of IP protocol numbers as directed by RFC 790.

Time To Live (TTL): number of hops that a


packet travels before being discarded by a
router.
Advantage : To avoid infinite looping.
A router keeps track of the hops in the
TTL field in the IP datagram header.
Header Checksum: used to check if the
packet is received error-free.

Addressing : unicast ,broadcast and multicasting addressing. Use 32 bit address representation.
 In which order are bytes of IP datagram are transmitted?
Transmission is row by row
Follow network byte order or Big endian ordering
IP ADDRESSING

www.google.com

DNS
N/W IP address N/W
Host
Host
NID HID
process
process
PORT NO :80
3

2
1

8bit 24bit

32bit
IP addressing

• The format of address is <netid,hostid>.


• Splits the entire 32 IP address in to 4 bytes.Each byte is shown as a decimal number from 0 to 255
• IP address is usually represented as XXX.XXX.XXX.XXX .(dotted decimal notation)
• The range of addresses are from 0.0.0.0 to 255.255.255.255
• There are five classes of IP addresses namely class A,classB,class C,class D and class E

Number of networks =2
𝑛𝑒𝑡𝑤𝑜𝑟𝑘𝑏𝑖𝑡𝑠
Number of hosts = 2ℎ𝑜𝑠𝑡𝑏𝑖𝑡𝑠 -2
IP addressing

Class A Address :The first bit of the first octet is always set to 0 (zero). Thus the first octet ranges from
1 – 127, i.e.

Class A addresses only include IP starting from 1.x.x.x to 126.x.x.x only. The IP range 127.x.x.x is
reserved for loopback IP addresses.

Class B Address : An IP address which belongs to class B has the first two bits in the first octet set
to 10, i.e.

Class B IP Addresses range from 128.0.x.x to 191.255.x.x.

Class C address : The first octet of Class C IP address has its first 3 bits set to 110, that is:
IP addressing

Class D Address: Very first four bits of the first octet in Class D IP addresses are set to 1110, giving a range of:

Class D has IP address rage from 224.0.0.0 to 239.255.255.255. Class D is reserved for Multicasting
class E Address This IP Class is reserved for experimental purposes only for R&D or Study. IP addresses in this
class ranges from 240.0.0.0 to 255.255.255.254.
11.0.0.0 21.0.0.0
IP Services
Unicasting

11.1.2.3 21.1.2.3

0 Source IP dest IP
Network Addresses
Address class Identification
Network and Host Identification
Network Addresses
Host Addresses
Default Subnet Masks
ANDing with Default Subnet masks

• Every IP address must be accompanied by a subnet mask


• Boundary Level masking(Mask values may be 0 or 255 in the mask address)
Non Boundary Level Masking

The number is appended to IP address after slash.


Ex 45.23.21.8/26
Procedure:
 For this write down the number of 1’s as given after slash. And complete the total 32 bits (if
the IPv4 ) using fill 0’ in right side.
 And then divide in 8 bit groups. Write down the equivalent decimal value of each group.
• 11111111. 11111111 .11111111 .11000000
• Mask address is 255.255.255.192
Exercise : The prefix of 128.42.5.4 with netmask is /21.
Mask Address :
255.255.248.0 in binary: 11111111 11111111 11111000 00000000 ----------------------------------- I
counted twenty-one 1s -------> /21

128.42.5.4 in binary: 10000000 00101010 00000101 00000100


255.255.248.0 in binary: 11111111 11111111 11111000 00000000 -----------------------------------
[Logical AND] 10000000 00101010 00000000 00000000 ------> 128.42.0.0
Subnetting

• Process of stealing bits from the HOST part of an IP address in order to divide the larger
network into smaller sub-networks called subnets
• We always reserve an IP address to identify the subnet and another one to identify the
broadcast address within the subnet

 Having 5 bits available for defining subnets means that we can have up to 32 (2^5)
different subnets.
Subnetting a Class C Address Using the Binary Method

Let's use IP address 192.168.10.44 with subnet mask 255.255.255.248or /29.


STEP 1: Convert to Binary

STEP 2: Calculate the Subnet Address


Perform a bit-wise AND operation (1+1=1, 1+0 or 0+1 =0, 0+0=0)
on the host IP address and subnet mask
Subnetting a Class C Address Using the Binary Method

STEP 3: Find Host Range


These 5 bits are used to identify the subnets. The remaining 3 bits are used for defining hosts within a
particular subnet.
Subnetting a Class C Address Using the Binary Method
Subnetting a Class C Address Using the Binary Method

STEP 4: Calculate the Total Number of Subnets and Hosts Per Subnet
How to determine the number of subnets and the number of
hosts per subnet

Two formulas can provide this basic information:


Second subnet formula: Number of needed subnets = 2𝑠 -2
Number of needed hosts per subnet = 2ℎ -2
For example if two bits are borrowed for the network portion of the address

Find number of Subnets


Find the number of host per subnet
Subnetting a Class C Address Using the Binary Method

• Number of needed subnets ……………….


• Number of needed usable hosts
• Address class ………….
• Default subnet mask …………….
• Custom subnet mask …………….
• Total number of subnets ………..
• Total number of host addresses ……………
• Number of usable addresses …………….
• Number of bits borrowed……………………
Problem 1: Network address 192.10.10.0/28
Find the following as mentioned above
Problem 2: Network address : 165.100.0.0
Given : Number of needed subnets : 1000,needed usable hosts : 60
Fin the remaining field .
Working Example:
Why computers need MAC and IP address

B
Imagine a situation. Computers A, B, C, and Computers 1,2,3.
A
Computers A, B, and C know each other. 2
And Computers 1,2, and 3 know each other
3
But Computer C, and Computer 1 are special in that they
also know each other . C 1

Objective: Computer A wants to send a message to Computer 2, how does it happen?


The ones that are known are ROUTERS .
IP Addresses are logical and routeable addresses. MAC Addresses are physical and are NOT routeable.
• MAC Addresses handle the physical connection from computer to computer while IP Addresses
handle the logical routeable connection from both computer to computer AND network to
network.
Address Resolution Protocol

Address Resolution Protocol is a communication protocol used for discovering physical


address associated with given network address(IP Address).

Typically, ARP is a network layer to data link layer mapping process, which is used to
discover MAC address for given Internet Protocol Address.

ARP discovery – A broadcast address used by sender for discovering MAC of


destination (host) with in network
ARP-reply -Receiver responds with ARP reply packet about it existence using unicast
addressing
Introducing Gateways

Gateways are network protocol converters. Often the two networks that a gateway joins use
different base protocols.
A gateway can be implemented completely in software, hardware, or a combination of both.
network gateway by definition appears at the edge of a network, related capabilities such
as firewalls and proxy servers tend to be integrated with it.

A gateway is a node (router) in a computer network, a key stopping point for data on its way to or from
other networks.
Reverse ARP

 Reverse ARP is a networking protocol used by a client machine in a local area network to
request its Internet Protocol address (IPv4) from the gateway-router’s ARP table.
 The network administrator creates a table in gateway-router, which is used to map the MAC
address to corresponding IP address.
 When a new machine is setup or any machine which don’t have memory to store IP
address, needs an IP address for its own use.
 A special host configured inside the local area network, called as RARP-server is responsible
to reply for these kind of broadcast packets.
 Now the RARP server attempt to find out the entry in IP to MAC address mapping table.
 If any entry matches in table, RARP server send the response packet to the requesting device
along with IP address.
 LAN technologies like Ethernet, Ethernet II, Token Ring and Fiber Distributed Data Interface
(FDDI) support the Address Resolution Protocol.
 RARP is not being used in today’s networks. Because we have much great featured protocols
like BOOTP (Bootstrap Protocol) and DHCP( Dynamic Host Configuration Protocol).
IP addressing

broadcasting

directed
20.0.0.0
11.0.0.0

11.1.3.4

11.0.0.0

11.1.2.3 limited
IP fragmentation

A maximum transmission unit (MTU) is the largest size packet or frame, specified in octets (eight-bit bytes), that can be sent in a
packet- or frame-based network such as the Internet

router

Size of
IP >100
MTU=1000 DF=1 MTU=100
Router is
restricted
and so
discard the
packet
IP fragmentation
Note: The field is 13 bits wide, so the offset can be from 0 to 8191.
Fragments are specified in units of 8 bytes

source destination

Note: Max size of fragment =MTU-IP Header size (min 20 bytes to max 60 bytes)

Ignore length of headers


ID= 192.28.0.1
Before Data Len=2300
MTU=2300 Offset=0
MF=0
Indicates last fragment

After ID= 192.28.0.1 ID= 192.28.0.1


MTU=2300 Data Len=1500 Data Len=800
Offset=0 Offset=(0+1500)/8
MF=1 MF=0
Path MTU discovery

• Avoid fragmentation
• Router provide feedback if too large.Discover the MTU that will fit

try 1200 bytes


2 try 900 bytes

1
Communication over Internet using TCP/IP
Underlying infrastructure for communication over internet

ISP’s
BSNL.MTNL. ...Bharti Airtel. ...Hathway Cable. ...Tata Communications.
 Subscribed users access the ISP network through a local phone number or dedicated line at one place
called Point of Presence
 In real internet dozens of large ISP interconnect at NAP(Network Access Point).
 The National Science Foundation (NSF) created the first high-speed backbone in 1987. Called NSFNET, it
was a T1 line that connected 170 smaller networks together and operated at 1.544 Mbps (million bits per
second)
 In Windows, use tracert www.yahoo.com. From a Unix prompt, type traceroute www.yahoo.com.
 Backbones are typically fiber optic trunk lines. The trunk line has multiple fiber optic cables combined
together to increase the capacity
Routing metrics

• Metrics are the network variables used in deciding what path is preferred for reaching
destination
• The most common metric values are hop, bandwidth, delay, reliability, load, and cost.
Hop
The hop count refers to the number of intermediate devices through which data must pass
between source and destination.

Disadvantage:
The upper path may contain a slower link, such as 56Kb dial-
up link
lower path may consist of more hops but faster links, such
as gigabit Ethernet.
Routing metrics

Bandwidth
Protocols that consider the capacity of a link use this metric. The lower path is longer (in terms of hops), but
preferred because the bandwidth capacity end to end is greater than the upper path.

Delay
Protocols that use this metric must determine
the delay values for all links along the path
end to end, considering the path with the
lowest (cumulative) delay to be a better route
Routing metrics

Reliability
Links experiencing more problems would be considered less reliable than others making them less desirable
paths—the higher the reliability the better the path.
The value is generally measured as a percentage of 255, with 255 being the most reliable and less than that is
considered as un reliable

Load
Load measures the amount of traffic occupying the
link over this time frame as a percentage of the
link‘s total capacity.

The value 255 is equivalent to 100% utilization or load—


) across this link. the higher the value the higher the traffic load
(bandwidth utilization) across this link.
Routing metrics

As traffic increases, this value increases. Values approaching 255 indicate congestion, while lower
values indicate moderate traffic loads. the lower the value, the less congested the path, the more
preferred

Cost
• Network administrators can affect the way routers make path decisions by setting arbitrary
metric values on links along the path end to end.
• These arbitrary values are typically single integers with lower values indicating better paths.
• costs are automatically assigned based on the bandwidth of a link
• Costs are static today, mostly because no one has ever figured out a way to do a stable
routing protocol with dynamic costs.
Network Routing(Dijkstra’s Algorithm )
Network Routing(Dijkstra’s Algorithm )
Network Routing(Dijkstra’s Algorithm )

Routing table for source Node 1


Link state routing

D C

seq seq  Sequence number controls flooding


TTL TTL
 Construct routing table using global knowledge
11 B 3
C 11

B 7
D 11  Applies disjkstras algorithm for routing table
updation
A 1 7
3
 Converges faster when compared to DVR
1
 Sequence number is assigned for a packet
 For a limited period of time
 Looping is transient

2
B
A seq
seq TTL
TTL A 2
B 2 7 11
D 1 C 3
DSR versus LSR
DVR LSR
BW is less BW is more
Local knowledge Global knowledge
Bellman ford algorithm Dijkstras algorithm
Less traffic More traffic
Periodic updates Periodic updates
Convergence is slow Convergence is fast
Count to infinity No count to infinity due to global
knowledge
Uses Routing information protocol Open shortest path first
Looping is persistent Looping is transcient
ICMP(Internet Control Message protocol)

• IP does not have a inbuilt mechanism for sending error and control messages. ICMP takes
initiative.
• used for reporting errors and management queries
• Source quench message :Receiving host detects that rate of sending packets (traffic rate) to it is too
fast it sends the source quench message to the source to slow the pace down so that no packet can be
lost.
• ICMP will take source IP from the discard
ed packet and informs to source by sending
source quench message.
Then source will reduce the speed of
transmission so that router will free for congestion.
ICMP(Internet Control Message protocol)

When the congestion router is far away from the source the
ICMP will send hop by hop source quench message so that
every router will reduce the speed of transmission.

Parameter problem

Whenever packets come to the router then calculated


header checksum should be equal to recieved header
checksum then only packet is accepted by the router.

ICMP will take the source IP from the discarded packet and informs to
source by sending parameter problem message.
ICMP(Internet Control Message protocol)

• Time exceeded message :


• When some fragments are lost in a network then the holding fragment by the router will be
droped then ICMP will take source IP from discarded packet and informs to the source, of
discarded datagram due to time to live field reaches to zero, by sending time exceeded
message.
ICMP(Internet Control Message protocol)

• Destination un-reachable :
• Destination unreachable is generated by the host or its inbound gateway to inform the client that the
destination is unreachable for some reason.

There is no necessary condition that only router give the ICMP error message some time
destination host send ICMP error message when any type of failure (link failure,hardware
failure,port failure etc) happen in the network.
ICMP(Internet Control Message protocol)
The default gateway for Host H is configured to use router
R1. Host H sends a packet to router R1 to reach the
destination on Remote Branch office Host 10.1.1.1. Router
R1, after it consults its routing table, finds that the next-hop
to reach Host 10.1.1.1 is router R2

Router R1 forwards the packet to router R2 and also sends


an ICMP redirect message to Host H.

This informs the host that the best route to reach Host
10.1.1.1 is by way of router R2. Host H then forwards all the
subsequent packets destined for Host 10.1.1.1 to router R2.

Potrebbero piacerti anche