IS 171 - Introduction To Computer Networks: Layered Models - TCP/IP Addressing in TCP/IP

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 35

IS 171 - Introduction to

Computer Networks

Layered Models – TCP/IP


Addressing in TCP/IP

04/12/23 1
Layered Models
1. OSI reference model
2. TCP/IP reference model

04/12/23 2
TCP/IP reference model
• The layers in the TCP/IP protocol suite do not exactly match those in
the OSI model.
• The original TCP/IP protocol suite was defined as having four layers:
• Host-to-network
• Internet
• Transport
• Application

04/12/23 3
TCP/IP vs OSI reference model

04/12/23 4
TCP/IP vs OSI reference model
• The upper layers
• Session
• Permits two parties to hold ongoing communication (session) across a network
• Not found in TCP/IP model; its functions are provided by the TCP/IP Transport layer
• Presentation
• Handles data format information for networked communication
• Not found in TCP model; its functions are provided by the TCP/IP Application layer
• Application
• Provides a set of interfaces for applications to obtain access to networked services
• OSI protocols: FTAM, VT, MHS, DS, CMIP
• TCP/IP protocols: FTP, SMTP, TELNET, DNS, SNMP

04/12/23 5
TCP/IP vs OSI reference model
• FTAM - File Transfer Access and Management
• VT - Virtual Terminal protocol
• MHS - Message handling system
• DS - Directory services
• CMIP - Common Management Information Protocol
• FTP - File Transfer Protocol
• SMTP - Simple Mail Transfer Protocol
• TELNET – Network Virtual Terminal Protocol (for accessing remote computers)
• DNS - Domain Name System
• SNMP - Simple Network Management Protocol

04/12/23 6
TCP/IP vs OSI reference model
• The Transport Layer
• Provides “transparent” transfer of data from a source end open system to a
destination end open system
• OSI Layer 4
• TCP/IP protocols: TCP and UDP
• Most functions and specification of TCP and UDP in TCP/IP model map to the
OSI Transport layer
• Both models employ connectionless and connection-oriented services at the
Transport layer

04/12/23 7
TCP/IP vs OSI reference model
• The Network Layer
• Provides both connectionless and connection-oriented services in OSI
• For the TCP/IP architecture, the Internet layer is exclusively connectionless
• OSI Layer 3
• TCP/IP Internet layer
• Protocols:
• OSI – CLNP (Connection-Less-mode Network Service)
• TCP/IP – IP (Internet Protocol)
• Virtually identical services; CLNP allows variable-length addresses while IP supports
fixed-size addresses (32 bits)

04/12/23 8
TCP/IP vs OSI reference model
• Data Link Layer
• Provides for the control of the physical layer, and detects and possibly
corrects errors which may occur
• OSI – Layer 2
• TCP/IP – Data Link + Physical Layer (Host-to-Network)
• Transforms a stream of raw bits (0s and 1s) from the physical into a data
frame and provides an error-free transfer from one node to another

04/12/23 9
TCP/IP vs OSI reference model
• Comparison and contrast OSI TCP/IP

between the models Application (7)


Presentation (6) Application
• General Comparison Session (5)
1. Focus of Reliability Control Transport (4) Transport
2. Roles of Host system Network (3) Internet
3. De-jure vs De-facto Data Link (2) Data Link
Physical (1)

04/12/23 10
TCP/IP vs OSI reference model
1. Reliability
• OSI
• Places emphasis on providing a reliable data transfer service
• Each layer detects and handles errors
• Each data transmitted includes checksums
• The Transport layer checks source-to-destination reliability
• TCP/IP
• Reliability control is concentrated at the Transport layer
• Transport layer handles all error detection and recovery
• Transport layer uses checksums, acknowledgements and timeouts to control
transmission

04/12/23 11
TCP/IP vs OSI reference model
2. Roles of Host system
• OSI
• Hosts do not handle network operations (simple terminal)
• TCP/IP
• Hosts participate in most network protocols (end-to-end verification, routing, network
control)
• Achieved using Internet layer (viewed as a data delivery system involving intelligent
hosts)

04/12/23 12
TCP/IP vs OSI reference model
3. De-jure vs De-facto
• De-jure: describes practices that are legally recognized by official laws
• De-facto (in fact, in practice): describes situations that are generally known to exist in reality,
even if not legally authorized
• OSI:
• Standard legislated by official recognized body (ISO)
• OSI model devised before the protocols were invented – made the model more general and
not biased towards a particular protocol
• Negative side: protocol designers did not have much experience, did not have an idea of
which functionality to put in which layer
• Positive side: protocols in the OSI are better hidden- can be replaced easily as technology
changes
• Complex, costly, not widespread as TCP/IP
• More commonly used as teaching aid

04/12/23 13
TCP/IP vs OSI reference model
• De-jure vs De-facto
• TCP/IP
• Standard adopted due to widespread use (Internet)
• The protocols came first, and the model later (just a description of the
existing protocols)
• More popular standard for internetworking:
• Relatively simple and robust compared to OSI
• Available on virtually every hardware and operating system platform (often free)
• The protocol suite on which the Internet depends

04/12/23 14
TCP/IP vs OSI reference model
• Similarity (summary)
• Both are based on the concept of a stack (layers) of independent
protocols
• The functionality of the layers is roughly similar

04/12/23 15
TCP/IP vs OSI reference model
• Differences
OSI TCP/IP
Makes the distinction between services, Does not originally clearly distinguish
interfaces, and protocol between services, interface, and protocol
Devised before the protocols were invented A description of the existing protocols
– can work in diverse heterogeneous
networks
Supports both connectionless and Supports only connectionless mode in the
connection-oriented communication in the Network layer, but supports both modes in
Network layer, but only connection-oriented the Transport layer
in the Transport layer
Has seven layers Has four layers
Emphasis is on providing a reliable data Treats reliability as an end to end problem
transfer service at each layer
04/12/23 16
04/12/23 17
Addressing in TCP/IP
• Four levels are used in TCP/IP protocols
1. Physical
2. Logical
3. Port
4. Specific

04/12/23 18
Addressing in TCP/IP
• Each address is related to one layer in the TCP/IP architecture

04/12/23 19
Addressing in TCP/IP
1. Physical address (Link address)
• The address of a node as defined by its LAN or WAN
• Lowest level address; included in the frame used by the data link layer
• Size and format of address vary depending on the network
• Ethernet: 6 byte (48 bits) physical address imprinted on the Network Interface Card
(NIC)
• Most LANs use 48-bit (6 byte) physical address written as 12 hexadecimal
digits
• Every byte (2 hexadecimal digits) is separated by a colon
• E.g. 07:01:02:01:2C:4B

04/12/23 20
Addressing in TCP/IP
• Physical address – example
• Two nodes (10 and 87) are connected by a link (bus topology LAN)
• Node 10 is a sender and node 87 is a receiver; node 10 sends a frame to node 87
• At the data link layer, this frame contains physical (link) addresses in the header (87 - destination address
and 10 – source address)
• The frame is propagated through the LAN; each node with a physical address other than 87 drops the
frame – the physical address on the frame does not match the node’s address
• The intended destination node finds a match with its own physical address and accepts the frame

04/12/23 21
Addressing in TCP/IP
• Physical addresses can be either
• Unicast – one single recipient
• Multicast – a group of recipients
• Broadcast – received by all nodes in the network
• A source address is always a unicast address – the frame comes from only one station
• Destination address can be unicast, multicast or broadcast
• The least significant bit of the first byte defines the type of address (unicast – 0;
multicast – 1)
• Broadcast addresses have the value FF:FF:FF:FF:FF:FF (all 1s)

04/12/23 22
Addressing in TCP/IP
• Exercise: Define the type of the following destination addresses:
• 4A:30:10:21:10:1A
• 47:20:1B:2E:08:EE
• FF:FF:FF:FF:FF:FF

04/12/23 23
Addressing in TCP/IP
2. Logical addresses
• Necessary for universal communications that are independent of underlying
physical networks
• Physical addresses – not adequate in an internetwork environment –
different networks can have different address formats
• A universal addressing system is needed - each host must be identified
uniquely, regardless of the underlying physical network
• The Internet currently uses a 32-bit address (IP address) that can uniquely
define a host connected to the Internet
• No two publicly-addressed and visible hosts on the Internet can have the
same IP address

04/12/23 24
Addressing in TCP/IP
• Logical address – example
• Figure shows part of the Internet with two
routers connecting three LANs
• Each device (computer or router) has a pair of
addresses (logical and physical) for each
connection
• Each computer is connected to only one link and
therefore has only one pair of addresses
• Each router is connected to three networks (only
two are shown), hence three pairs of addresses,
one for each connection
• Logical addresses – letters, Physical addresses -
numbers

04/12/23 25
Addressing in
TCP/IP
• Logical address – example
• Host with logical address A and physical address
10 needs to send a packet to a host with
physical address 95 and logical address P
• Data encapsulated at network layer and one
pair of (logical) addresses are added: A (source)
and P (destination)
• In most protocols, the logical source address
comes before the logical destination address
(contrary to the order of physical addresses) Next hop Source Source Destn.
Physical Physical Logical Logical
• The network layer needs to find the physical Address Address Address Address
address of the next hop before the packet is
delivered
• From a routing table, the logical address of the 20 10 A P Data
next hop (router 1) is F
04/12/23 26
Addressing in TCP/IP
• Another protocol, ARP (Address Resolution Protocol) is used to find the physical address
of router 1 – 20
• The network layer passes this address (20) to the data link layer
• Data link layer encapsulates the packet with physical destination (next hop) address, 20,
and physical source address 10
• The router de-capsulates the packet from the frame to read the logical destination
address P.
• Since the logical destination address (P) does not match the router’s logical address (F),
the router knows that the packet needs to be forwarded
• The router consults its routing table and ARP to find the physical destination address of
the next hop (router 2), creates a new frame, encapsulates the packet, and sends it to
router 2
04/12/23 27
Addressing in TCP/IP
• Note
• The source physical address changes from 10 (source computer) to 99
• Now the (physical) source is router 1
• The destination physical address changes from 20 (router 1) to 33 (router 2
physical address)
• The logical source and destination addresses remain the same
• At router 2, physical addresses change and a new frame is sent to destination
computer
• The destination logical address P matches the logical address of the computer
• At destination, the data is de-capsulated from the packet and sent to upper layer
• The physical addresses will change from hop to hop, but the logical addresses
remain the same
04/12/23 28
Addressing in TCP/IP
3. Port addresses
• Data transfer from source to destination is enabled by physical and logical
addressing
• Computers run multiple processes at the same time
• End objective of Internet communication is a process communicating with another
process at the same time
• E.g. computer A can communicate with computer B by using TELNET
• At the same time computer A can be communicating with computer C using FTP
• For these processes to receive data simultaneously, a method is needed to label the
different processes
• A label assigned to a process is called a port address
• A port address in TCP/IP is 16 bits long represented by one decimal number, e.g. 753

04/12/23 29
Addressing in TCP/IP
• Port addresses – example
• Two computers A and B are communicating
via the Internet
• Computer A is running three processes with
port addresses a, b and c
• Computer B is running two processes with
port addresses j and k
• Process a in computer A needs to
communicate with process j in computer B
• When using TCP, port address at A and B are
different since one computer is a server
program and the other a client program

04/12/23 30
Addressing in TCP/IP
• Data is encapsulated with source and destination port addresses at the
transport layer (a and j)
• The packet from the transport layer is encapsulated in another packet at
the network layer with logical source and destination addresses (A and P)
• The process is continued at each layer – encapsulation with physical source
and destination addresses of the next hop (in the Internet, as previously
described)

04/12/23 31
Addressing in TCP/IP
• In TCP/IP, port numbers are integers between 0 – 65,535 (i.e. 2 16 = 65,536)
• The client program defines itself with a port number, called the ephemeral
port number, (chosen randomly)
• Ephemeral means short lived
• The server process must also define itself with a port number (called well-
known port numbers)
• This port number cannot be chosen randomly
• ICANN – Internet Corporation for Assigned Names and Numbers

04/12/23 32
Addressing in TCP/IP
• ICANN has divided the port numbers in three ranges
• Well-known ports
• Range from 0 to 1023
• Assigned and controlled by ICANN
• Registered ports
• Range from 1024 to 49,151
• Not assigned or controlled by ICANN; can only be registered by ICANN to prevent
duplication
• Dynamic (private) ports
• Range from 49,152 to 65,535
• Neither controlled nor registered
• Can be used as temporary or private port numbers

04/12/23 33
Addressing in TCP/IP
4. Application-specific addresses
• User-friendly addresses that are designed for that specific application
• E.g. email address: johndoe@udsm.ac.tz
• E.g. Universal Resource Locator (URL): www.udsm.ac.tz
• These addresses get changed to the corresponding port and logical addresses
by the sending computer

04/12/23 34
TCP Encapsulation

04/12/23 35

You might also like