Ip Networks and Tcp-ip Iipntip001

67
CETTM MTNL 1 IP Networks & TCP-IP IP NETWORKS AND TCP-IP MODULE ID: IIPNTIP001

description

ICAO

Transcript of Ip Networks and Tcp-ip Iipntip001

  • CETTM MTNL

    1IP Networks & TCP-IP

    IP NETWORKS AND TCP-IP

    MODULE ID: IIPNTIP001

  • CETTM MTNL

    2IP Networks & TCP-IP

    Topics Covered

    1. Networks - LAN / WAN2. TCP-IP Introduction3. Comparison with DoD Model4. TCP-IP Protocol Suite5. TCP & UDP6. Inter Net Layer Protocols (IP)7. IP Addresses8. Classes and Subnets9. Private IP Addresses and NAT

  • CETTM MTNL

    3IP Networks & TCP-IP

    Networks

    LAN 1 LAN 2

    WAN

  • CETTM MTNL

    4IP Networks & TCP-IP

    Local Area Networks (LANs)

    LANs are designed to: Operate within a limited geographical area Allow multi access to high bandwidth media Control of network privately under local

    administration Provide full time connectivity to local services Connect physically adjacent devices

  • CETTM MTNL

    5IP Networks & TCP-IP

    Devices used

    Repeaters Hubs Bridges Switches Routers Links (cables & connectors)

  • CETTM MTNL

    6IP Networks & TCP-IP

    Wide Area Networks (WANs)

    WANs are designed to: Operate over large geographical area Allow access over serial interfaces operating

    at low speeds Provide full time & part time connectivity

  • CETTM MTNL

    7IP Networks & TCP-IP

    Devices used in WAN

    Routers

    Modems

    Links

  • CETTM MTNL

    8IP Networks & TCP-IP

    Network Topology

  • CETTM MTNL

    9IP Networks & TCP-IP

    Importance of Bandwidth

    Bandwidth is data transmission rate The maximum amount of information

    (bits/second) that can be transmitted along a channel

    It is limited by physics and technology It is critical to network performance

  • CETTM MTNL

    10IP Networks & TCP-IP

    TCP/IP and the DoD Model

    The Transmission Control Protocol / Internet Protocol (TCP/IP) suite was created by the Department of Defense (DoD) to ensure and preserve data integrity, as well as maintain communications in the event of catastrophic war

    If designed and implemented correctly, a TCP/IP network can be a truly dependable and resilient one.

  • CETTM MTNL

    11IP Networks & TCP-IP

    TCP/IP and the DoD Model

    The DoD model is basically a condensed version of the OSI model It is composed of four, instead of seven, layers: Process/Application layer Host-to-Host layer Internet layer Network Access layer

  • CETTM MTNL

    12IP Networks & TCP-IP

    The DoD and OSI models

  • CETTM MTNL

    13IP Networks & TCP-IP

    TCP/IP and the DoD Model

    A no. of protocols combine at the DoD models Process/Application layer to integrate the various activities and duties spanning the focus of the OSIs corresponding top three layers (Application, Presentation, and Session)

    The Process/Application layer defines protocols for node-to-node application communication and also controls user-interface specifications

    The Host-to-Host layer parallels the functions of the OSIs Transport layer, defining protocols for setting up the level of transmission service for applications

    It tackles issues such as creating reliable end-to-end communication and ensuring the error-free delivery of data

    It handles packet sequencing and maintains data integrity.

  • CETTM MTNL

    14IP Networks & TCP-IP

    TCP/IP and the DoD Model

    The Internet layer corresponds to the OSIs Network layer, designating the protocols relating to the logical transmission of packets over the entire network

    It takes care of the addressing of hosts by giving them an IP (Internet Protocol) address, and it handles the routing of packets

    The Network Access layer monitors the data exchange between the host and the network

    The equivalent of the Data Link and Physical layers of the OSI model, the Network Access layer oversees hardware addressing and defines protocols for the physical transmission of data.

  • CETTM MTNL

    15IP Networks & TCP-IP

    The TCP/IP protocol suite

  • CETTM MTNL

    16IP Networks & TCP-IP

    The Process/Application Layer Protocols

    Telnet

    FTP

    TFTP

    NFS

    SMTP

    LPD X Window

    SNMP

    DNS

    DHCP/BootP

  • CETTM MTNL

    17IP Networks & TCP-IP

    The Host-to-Host Layer Protocols

    The main purpose of the Host-to-Host layer is to shield the upper-layer applications from the complexities of the network.

    The two protocols at this layer: Transmission Control Protocol (TCP) User Datagram Protocol (UDP)

  • CETTM MTNL

    18IP Networks & TCP-IP

    Transmission Control Protocol (TCP)

    Transmission Control Protocol (TCP) takes large blocks of information from an application and breaks them into segments.

    It numbers and sequences each segment so that the destinations TCP protocol can put the segments back into the order the application intended.

    After these segments are sent, TCP (on the transmitting host) waits for an acknowledgement of the receiving ends TCP virtual circuit session, retransmitting those that arent acknowledged.

  • CETTM MTNL

    19IP Networks & TCP-IP

    Before a transmitting host starts to send segments, the senders TCP protocol contacts the destinations TCP protocol to establish a connection.

    What is created is known as a virtual circuit This type of communication is called connection-

    oriented During this initial handshake, the two TCP layers also

    agree on the amount of information thats going to be sent before the recipients TCP sends back an acknowledgement

    Transmission Control Protocol (TCP)

  • CETTM MTNL

    20IP Networks & TCP-IP

    TCP Segment Format

    The upper layers just send a data stream to the protocols in the Transport layers,

    TCP segments a data stream and prepares it for the Internet layer.

    The Internet layer then routes the segments as packets through an internetwork.

    The segments are handed to the receiving hosts Host-to-Host layer protocol, which rebuilds the data stream to hand to the upper-layer applications or protocols.

  • CETTM MTNL

    21IP Networks & TCP-IP

    TCP segment format

  • CETTM MTNL

    22IP Networks & TCP-IP

    TCP Segment Format

    The TCP header is 20 bytes long, or up to 24 bytes with options.

    The TCP segment contains the following fields: Source port :The port number of the application on

    the host sending the data. Destination port: The port number of the application

    requested on the destination host. Sequence number Puts the data back in the correct

    order or retransmits missing or damaged data, a process called sequencing.

    Acknowledgement number Defines which TCP octet is expected next.

  • CETTM MTNL

    23IP Networks & TCP-IP

    TCP Segment Format

    Header length :The number of 32-bit words in the TCP header. This indicates where the data begins. The TCP header (even one including options) is an integral number of 32 bits in length.

    Reserved Always set to zero. Code bits: Control functions used to set up and

    terminate a session. Window :The window size the sender is willing to

    accept, in octets. Checksum: The cyclic redundancy check (CRC),

    because TCP doesnt trust the lower layers and checks everything. The CRC checks the header and data fields.

  • CETTM MTNL

    24IP Networks & TCP-IP

    TCP Segment Format Urgent: A valid field only if the Urgent pointer in the code

    bits is set. If so, this value indicates the offset from the current sequence number, in octets, where the first segment of non-urgent data begins.

    Options: May be 0 or a multiple of 32 bits, if any. What this means is that no options have to be present (option size of 0).

    if any options are used that do not cause the option field to total a multiple of 32 bits, padding of 0s must be used to make sure the data begins on a 32-bit boundary.

    Data Handed down to the TCP protocol at the Transport layer, which includes the upper layer headers.

    TCP creates a lot of overhead. Application developers may opt for efficiency over reliability

    to save overhead, so User Datagram Protocol was also defined at the Transport layer as an alternative.

  • CETTM MTNL

    25IP Networks & TCP-IP

    TCP Connection EstablishmentHost A sends a TCP SYNchronize packet to Host B

    Host B receives A's SYN

    Host B sends a SYNchronize-ACKnowledgement

    Host A receives B's SYN-ACK

    Host A sends ACKnowledge

    Host B receives ACK.

    TCP socket connection is ESTABLISHED

  • CETTM MTNL

    26IP Networks & TCP-IP

    TCP Three WAY Handshake

    HOST A HOST B

    TIME IN THE NETWORK

    Send SYN Seq=x Receive SYN

    Send SYN seq=y ACK=x+1

    Receive SYN+ACKSend ACK=y+1

    Receive ACK

  • CETTM MTNL

    27IP Networks & TCP-IP

    TCP Connection TerminationThe client TCP sends the FIN segment first.

    The server TCP sends the ACK segment to confirm the receipt of the FIN from the client.

    It increments the sequence number of FIN by 1 and no other user data will add with the ACK segment.

    Server does not have any data for transmission, and then it sends the FIN segment to Client side.

    Then client sends the ACK segment again to the server side. The connection termination fulfilled.

  • CETTM MTNL

    28IP Networks & TCP-IP

    TCP 4 WAY TerminationHOST A HOST B

    TIMEIN THE NETWORK

    Established Connection

    Close WaitPassive Close

    Last ACK

    Closed

    Established Connection

    Active Close Fin-Wait 1

    Fin-Wait 2

    Time Wait

    Closed

    FIN

    ACK

    FIN

    ACK

  • CETTM MTNL

    29IP Networks & TCP-IP

    User Datagram Protocol (UDP)

    UDP is covered thoroughly in Request for Comments 768. The Requests for Comments (RFCs) form a series of notes,

    started in 1969,about the Internet UDP is preferred over TCP when reliability is already

    handled at the Process/Application layer. UDP does not sequence the segments and does not care in

    which order the segments arrive at the destination. UDP sends the segments off and forgets about them. It doesnt follow through, check up on them, or even allow

    for an acknowledgment of safe arrival. Because of this, its referred to as an unreliable protocol. This does not mean that UDP is ineffective, only that it

    doesnt handle issues of reliability.

  • CETTM MTNL

    30IP Networks & TCP-IP

    UDP doesnt create a virtual circuit, nor does it contact the destination before delivering information to it.

    Because of this, its also considered a connectionless protocol.

    Since UDP assumes that the application will use its own reliability method, it doesnt use any.

    This gives an application developer a choice when running the Internet Protocol stack: TCP for reliability or UDP for faster transfers.

    User Datagram Protocol (UDP)

  • CETTM MTNL

    31IP Networks & TCP-IP

    UDP Segment Format

  • CETTM MTNL

    32IP Networks & TCP-IP

    UDP Segment Format

    The UDP segment contains the following fields: Source Port: Port number of the application on the

    host sending the data. Destination Port: Port number of the application

    requested on the destination host. Length: Length of UDP header and UDP data. Checksum: Checksum of both the UDP header

    and UDP data fields. Data Upper-layer data.

    UDP, like TCP, doesnt trust the lower layers and runs its own CRC. Frame Check Sequence (FCS) is the field that houses the CRC

  • CETTM MTNL

    33IP Networks & TCP-IP

    Key Features of TCP and UDP

    TCP UDP

    Sequenced Unsequenced

    Reliable Unreliable

    Connection-oriented Connectionless

    Virtual Circuit Low overhead

    Acknowledgments No Acknowledgments

    Windowing Flow Control No Windowing Flow Control

  • CETTM MTNL

    34IP Networks & TCP-IP

    Port Numbers

    TCP and UDP must use port numbers to communicate with the upper layers, because they keeps track of different conversations crossing the network simultaneously.

    Originating source port numbers are dynamically assigned by the source host and will equal some number starting at 1024.

    Virtual circuits that dont use an application with a well-known port number are assigned port numbers randomly from a specific range

    These port numbers identify the source and destination application or process in the TCP segment.

  • CETTM MTNL

    35IP Networks & TCP-IP

    Numbers below 1024 are considered well-known port numbers and are defined in RFC 3232.

    Numbers 1024 and above are used by the upper layers to set up sessions with other hosts, and by TCP to use as source and destination addresses in the TCP segment.

    Port Numbers

  • CETTM MTNL

    36IP Networks & TCP-IP

    Port numbers for TCP and UDP

  • CETTM MTNL

    37IP Networks & TCP-IP

    Port Numbers

    Why does the source host make up a port number? To differentiate between sessions with different hostsHow else would a server know where information is coming from if it didnt have a different number from a sending host?TCP, UDP and the upper layers dont use hardware and logical addresses to understand the sending hosts address as the Data Link and Network layer protocols do. They use port numbers.

  • CETTM MTNL

    38IP Networks & TCP-IP

    Key Protocols That Use TCP and UDP

    TCP UDPftp 21 dns 53ssh 22 tftp 69

    telnet 23 snmp 161smtp 25dns 53http 80

  • CETTM MTNL

    39IP Networks & TCP-IP

    The Internet Layer Protocols

    There are two main reasons for the Internet layers existence: routing, and providing a single network interface to the upper layers.

    The following are the protocols at the Internet layer: Internet Protocol (IP) Internet Control Message Protocol (ICMP) Internet Group Management Protocol (IGMP) Address Resolution Protocol (ARP) Reverse Address Resolution Protocol (RARP) Proxy ARP

  • CETTM MTNL

    40IP Networks & TCP-IP

    Internet Protocol (IP)IP looks at each packets address. Then, using a routing table, it decides where a packet is to be sent next, choosing the best path.The protocols of the Network Access layer deal only with physical links (local networks).Identifying devices on networks requires answering these two questions: Which network is it on? And What is its ID on that network? The first answer is the software address, or logical address The second answer is the hardware address All hosts on a network have a logical ID called an IP address. This is the software, or logical, address and contains valuable encoded information, greatly simplifying the complex task of routing.

  • CETTM MTNL

    41IP Networks & TCP-IP

    Internet Protocol (IP)

    IP receives segments from the Host-to-Host layer and fragments them into datagrams (packets) if necessary.

    IP then reassembles datagrams back into segments on the receiving side.

    Each datagram is assigned the IP address of the sender and of the recipient.

    Each router (layer 3 device) that receives a datagram makes routing decisions based on the packets destination IP address.

  • CETTM MTNL

    42IP Networks & TCP-IP

    IP Header

  • CETTM MTNL

    43IP Networks & TCP-IP

    IP Header

    The following fields make up the IP header: Version: IP version number. Header Length: Header length (HLEN) in 32-bit words. ToS with IP Precedence Bits: Type of Service tells how

    the datagram should be handled. The first 3 bits are the priority bits. Total length: Length of the packet including header and

    data. Identifier Unique IP-packet value. Flags: Specifies whether fragmentation should occur. Fragment offset: Provides fragmentation and

    reassembly if the packet is too large to put in a frame. It also allows different maximum transmission units

    (MTUs) on the Internet.

  • CETTM MTNL

    44IP Networks & TCP-IP

    IP Header TTL The time to live (TTL) is set into a packet when it is

    originally generated. If it doesnt get to where it wants to go before the TTL expires, boomits gone. This stops IP packets from continuously circling the network looking for a home.

    Protocol Port of upper-layer protocol (TCP is port 6 or UDP is port 17 [hex]). Also supports Network layer protocols.

    Header checksum: Cyclic redundancy check (CRC) on header only.

    Source IP address :32-bit IP address of sending station. Destination IP address: 32-bit IP address of the station

    this packet is destined for. IP options Used for network testing, debugging, security,

    and more. Data After the IP option field will be the upper-layer data

  • CETTM MTNL

    45IP Networks & TCP-IP

    The Protocol field in an IP header

  • CETTM MTNL

    46IP Networks & TCP-IP

    Possible Protocols Found in the Protocol Field of an IP Header

    Protocol Protocol NumberICMP 1IGRP 9

    EIGRP 88OSPF 89IPv6 41GRE 47

    IPX in IP 111Layer 2 Tunnel (L2TP) 115

  • CETTM MTNL

    47IP Networks & TCP-IP

    Internet Control Message Protocol (ICMP)

    Internet Control Message Protocol (ICMP) works at the Network layer and is used by IP for many different services.

    ICMP is a management protocol and messaging service provider for IP.

    Its messages are carried as IP data-grams.

  • CETTM MTNL

    48IP Networks & TCP-IP

    Internet Control Message Protocol (ICMP)

    Some common events and messages that ICMP relates to: Destination Unreachable Buffer Full Hops Ping Traceroute

  • CETTM MTNL

    49IP Networks & TCP-IP

    Address Resolution Protocol (ARP)

    Address Resolution Protocol (ARP) finds the hardware address of a host from a known IP address.

    When IP has a datagram to send, it must inform a Network Access protocol, such as Ethernet or Token Ring, of the destinations hardware address on the local network.

    If IP doesnt find the destination hosts hardware address in the ARP cache, it uses ARP to find this information.

    ARP interrogates the local network by sending out a broadcast asking the machine with the specified IP address to reply with its hardware address.

  • CETTM MTNL

    50IP Networks & TCP-IP

    Reverse Address Resolution Protocol (RARP)

    When an IP machine happens to be a diskless machine, it has no way of initially knowing its IP address

    But it does know its MAC address Reverse Address Resolution Protocol (RARP)

    discovers the identity of the IP address for diskless machines by sending out a packet that includes its MAC address and a request for the IP address assigned to that MAC address.

    A RARP server, responds with the answer, and the identity is given

    RARP uses the information it does know about the machines MAC address to learn its IP address

  • CETTM MTNL

    51IP Networks & TCP-IP

    Local ARP broadcast

  • CETTM MTNL

    52IP Networks & TCP-IP

    RARP broadcast example

  • CETTM MTNL

    53IP Networks & TCP-IP

    IP Addressing

    Internet Protocol (IP) A unique identifier for host, on an IP network 32-bit binary number, usually expressed as 4

    dotted decimal values. Each decimal value represents 8 bits, in the

    range of 0 to 255

  • CETTM MTNL

    54IP Networks & TCP-IP

    Example of IP Address

    We see the address in the decimal formOur computer sees it in the binary form

    140.179.220.200

    Written in binary form:

    140. 179. 220. 200

    10001100.10110011.11011100.11001000

  • CETTM MTNL

    55IP Networks & TCP-IP

    (32 Bit Address 2^32 = 4.3 billion possible addresses) There are 5 different address classes. Only 3 are in commercial use at this time. You can determine the class of the address by looking

    at the first 4 bits of the IP address: Class A begin with 0xxx, or 1 to 126 decimal Class B begin with 10xx, or 128 to 191 decimal Class C begin with 110x, or 192 to 223 decimal Class D begin with 1110, or 224 to 239 decimal Class E begin with 1111, or 240 to 254 decimal

    Address Classes

  • CETTM MTNL

    56IP Networks & TCP-IP

    Network vs. Host

    Every IP address has 2 parts: One identifying the network it resides on Other identifying the host address on the

    network The class of the address and the subnet mask

    determine which part belongs to the network address and which part belongs to the host address

  • CETTM MTNL

    57IP Networks & TCP-IP

    IP Address Components

    The class of the address determines, by default, which part is for the network (N) and which part belongs to the host (H)

    Class A: NNNNNNNN.HHHHHHHH.HHHHHHHH.HHHHHHHH Class B: NNNNNNNN.NNNNNNNN.HHHHHHHH.HHHHHHHH Class C: NNNNNNNN.NNNNNNNN.NNNNNNNN.HHHHHHHH

  • CETTM MTNL

    58IP Networks & TCP-IP

    IP Address Components - Eg

    Our example is a Class B address 140.179.220.200 By default, the Network part of the address is defined

    by the first 2 octets: 140.179.x.x

    By default, the Host part of the address is defined by the last 2 octets: x.x.220.200

  • CETTM MTNL

    59IP Networks & TCP-IP

    Two Reserved Addresses on a Subnet

    In order to specify the Network Address of a given IP address, the Host portion is set to all 0s: 140.179.0.0

    If all the bits in the Host portion are set to 1s, then this specifies the broadcast address that is sent to all hosts on the network: 140.179.255.255

  • CETTM MTNL

    60IP Networks & TCP-IP

    Subnet Mask

    Subnet masks are applied to an IP address to identify Network portion and Host portion of the address.

    Computer performs a bitwise logical AND operation between the address and the subnet mask in order to find the Network Address or number.

  • CETTM MTNL

    61IP Networks & TCP-IP

    Default Subnet Masks

    Class A - 255.0.0.011111111.00000000.00000000.00000000

    Class B - 255.255.0.011111111.11111111.00000000.00000000

    Class C - 255.255.255.011111111.11111111.11111111.00000000

  • CETTM MTNL

    62IP Networks & TCP-IP

    Logical Bitwise AND Operation

    140.179.220.200 Class B address255.255.0.0 Subnet Mask

    In Binary:

    10001100.10110011.11110000.1100100011111111.11111111.00000000.0000000010001100.10110011.00000000.00000000

    By doing this, the computer has found that our Network Address is 140.179.0.0

  • CETTM MTNL

    63IP Networks & TCP-IP

    IP Addressing Methods

    Static Address

    Manually entered addresses

    Dynamic Address

    Allocated from a pool of Addresses by DHCP

  • CETTM MTNL

    64IP Networks & TCP-IP

    Private IP Addresses

    You can use these addresses on any private LAN.

    You CANNOT use them on the internet. Internet routers will block them. Class A10.0.0.0 - 10.255.255.255 Class B172.16.0.0 - 172.31.255.255 Class C192.168.0.0 - 192.168.255.255

  • CETTM MTNL

    65IP Networks & TCP-IP

    Network Address Translation

    Packets with Private IP addresses cannot not be routed on a public network

    NAT maps the private IP addresses on a home network to the public IP addresses which is the IP address supplied by an Internet Service Provider (ISP)

    NATing is done at the boundary of the private network (LAN)

  • CETTM MTNL

    66IP Networks & TCP-IP

    Summary

    TCP-IP is based on DoD Model There are various protocols in TCP-IP

    Protocol Suite TCP is reliable but UDP is not reliable Port No.s identify source and destination

    application IP is a Internet layer Protocol IP address is 32 bit in size These are 3 Classes for commercial use In each class some range of IP addresses are

    reserved for Private use

  • CETTM MTNL

    67IP Networks & TCP-IP

    References

    Books: TCP/IP ILLUSTRATED -W.RICHARD

    STEVENS INSIDE TCP/IP - KRANJIT S. SIYAN CCNA Cisco certified network associate - T.

    Lammle URLs: http://en.wikipedia.org http://cisco.com

    Slide 1Slide 2Slide 3Slide 4Slide 5Slide 6Slide 7Slide 8Slide 9Slide 10Slide 11Slide 12Slide 13Slide 14Slide 15Slide 16Slide 17Slide 18Slide 19Slide 20Slide 21Slide 22Slide 23Slide 24Slide 25Slide 26Slide 27Slide 28Slide 29Slide 30Slide 31Slide 32Slide 33Slide 34Slide 35Slide 36Slide 37Slide 38Slide 39Slide 40Slide 41Slide 42Slide 43Slide 44Slide 45Slide 46Slide 47Slide 48Slide 49Slide 50Slide 51Slide 52Slide 53Slide 54Slide 55Slide 56Slide 57Slide 58Slide 59Slide 60Slide 61Slide 62Slide 63Slide 64Slide 65Slide 66Slide 67