Net 13 14 Transport Layer Protocol

Embed Size (px)

Citation preview

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    1/35

    Ashis Talukder, Assistant Professor,MIS, DU.

    1

    Lecture On

    Transport LayerProtocols

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    2/35

    Ashis Talukder, Assistant Professor,MIS, DU.

    2

    Last Class

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    3/35

    Ashis Talukder, Assistant Professor,MIS, DU.

    3

    IP Address & IP Protocol:

    Introduction: IP address

    Subnet Mask

    Classes of IP Address: A, B, C, D, E

    IP Header format

    ICPM

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    4/35

    Ashis Talukder, Assistant Professor,MIS, DU.

    4

    Todays Class

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    5/35

    Ashis Talukder, Assistant Professor,MIS, DU.

    5

    Transport Layer Protocols

    TCP header

    3-way handshaking

    PAR

    Denial of service attack (DoS)

    Sequence Number

    Windowing

    Multiple Conversation

    Socket

    UDP

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    6/35

    Ashis Talukder, Assistant Professor,MIS, DU.

    6

    Transport Layer

    encapsulation

    Segmentation andreassembly

    connection control

    Establish

    Maintain

    terminate

    ordered delivery

    flow control error control

    Detection

    recovery

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    7/35

    Ashis Talukder, Assistant Professor,MIS, DU.

    7

    Transport Layer

    Addressing

    Port Address

    Handle Multiple

    Conversation Reliable transmission

    Sendsacknowledgements

    Also provideconnectionless streamdata transmission(UDP)

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    8/35

    Ashis Talukder, Assistant Professor,MIS, DU.

    8

    Transport Layer Protocols

    Transmission Control Protocol (TCP)

    User Datagram Protocol (UDP)

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    9/35

    Ashis Talukder, Assistant Professor,MIS, DU.

    9

    Transmission Control Protocol(TCP)

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    10/35

    Ashis Talukder, Assistant Professor,MIS, DU. 10

    TCP Header

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    11/35

    Ashis Talukder, Assistant Professor,MIS, DU. 11

    Three Way handshaking

    For a connection to beestablished, the two endstations must synchronize oneach other's initial TCPsequence numbers

    Sequence numbers are used totrack the order of packets andto ensure that no packets arelost in transmission.

    The initial sequence number isthe starting number used whena TCP connection isestablished.

    Exchanging beginningsequence numbers during theconnection sequence ensuresthat lost data can berecovered.

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    12/35

    Ashis Talukder, Assistant Professor,MIS, DU. 12

    3wayHandshaking: 1st Step

    In step one, the initiating host (client) sendssynchronization (SYN flag set) packet toinitiate a connection.

    This indicates that a packet has a valid initial

    Sequence Number value in this segment for thissession of x.

    The SYN bit set in the header indicates aconnection request.

    The SYN bit is single bit in the code field of theTCP segment header.

    The Sequence Number is a 32 bit field TCPsegment header.

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    13/35

    Ashis Talukder, Assistant Professor,MIS, DU. 13

    3wayHandshaking: 2nd Step

    In step two, the other host receivesthe packet, records the SequenceNumber of x from the client, andreplies with an acknowledgment (ACKflag set).

    The ACK control bit set indicates thatthe Acknowledgment Number fieldcontains a valid acknowledgmentvalue.

    The ACK flag is a single bit in the codefield of the TCP segment header and

    the Acknowledgment Number is a 32bit field TCP segment header.

    Once a connection is established, theACK flag is set for all segments duringthe session.

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    14/35

    Ashis Talukder, Assistant Professor,MIS, DU. 14

    3wayHandshaking: 2nd Step

    The Acknowledgment Number fieldcontains the next sequencenumber that this host is expectingto receive (x + 1).

    The Acknowledgment Number of x+ 1 means the host has receivedall bytes up to and including x,and expects to next receive byte x+ 1.

    The host also initiates a return

    session. This includes a TCPsegment with its own initialSequence Number value of y andwith the SYN flag set.

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    15/35

    Ashis Talukder, Assistant Professor,MIS, DU. 15

    3wayHandshaking: 3rd Step

    In step three, theinitiating host respondswith a simpleAcknowledgment

    Number value of y + 1,which is the SequenceNumber value of Host B+ 1.

    This indicates that it

    received the previousacknowledgment andfinalizes the connectionprocess for this session.

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    16/35

    Ashis Talukder, Assistant Professor,MIS, DU. 16

    Denial of Service Attack (DoS)

    Denial of service (DoS) attacks is designed todeny services to legitimate hosts that attemptto establish connections.

    DoS attacks are commonly used by hackers tohalt system responses.

    One example is SYN flooding, which occursduring the three-way handshake process.

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    17/35

    Ashis Talukder, Assistant Professor,MIS, DU. 17

    Denial of Service Attack

    As a packet with the SYN bitset is sent, it includes its IPaddress and the destinationIP address.

    This information is then usedby the destination host tosend the SYN/ACK packetback.

    In the DoS attack, the

    hacker initiatessynchronization but spoofsthe source IP address.

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    18/35

    Ashis Talukder, Assistant Professor,MIS, DU. 18

    Denial of Service Attack The destination device responds

    to a non-existent, unreachableIP address and is placed in awaiting state.

    This waiting state is placed in aholding area that uses memory.

    Hackers flood the host withthese false SYN requests todeplete all the connection andmemory resources of the host.

    To defend against theseattacks:

    system administrators maydecrease the connectiontimeout period and

    increase the connectionqueue size.

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    19/35

    Ashis Talukder, Assistant Professor,MIS, DU. 19

    Windowing & Window Size

    TCP segments the upperlayer Data

    Once the data is segmented,it must be transmitted to the

    destination device. One of the services provided

    by TCP is flow control, whichregulates how much data issent during a given

    transmission period. The process of flow control is

    known as windowing.

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    20/35

    Ashis Talukder, Assistant Professor,MIS, DU. 20

    Windowing & Window Size Window size determines the

    amount of data that can betransmitted at one time beforethe destination responds withan acknowledgment.

    After a host transmits thewindow-sized number of bytes,the host must receive anacknowledgment that the datahas been received before it cansend any more data.

    For example, if the window sizeis 1, each byte must beacknowledged before the nextbyte is sent.

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    21/35

    Ashis Talukder, Assistant Professor,MIS, DU. 21

    Windowing & Window Size TCP utilizes windowing to

    dynamically determinetransmission size.

    Devices negotiate a windowsize to allow a specificnumber of bytes to betransmitted before anacknowledgment.

    This process of dynamicallyvarying the window size

    increases reliability. The window size can be

    varied based uponacknowledgments.

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    22/35

    Ashis Talukder, Assistant Professor,MIS, DU. 22

    Windowing & Window Size

    TCP breaks data into segments.

    After the synchronization processoccurs and the window size hasbeen established, the data

    segments are transported fromthe sender to the receiver.

    The data segments must bereassembled after all the data isreceived.

    There is no guarantee that thedata will arrive in the order itwas transmitted.

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    23/35

    Ashis Talukder, Assistant Professor,MIS, DU. 23

    Windowing & Window Size TCP applies sequence numbers

    to the data segments that aretransmitted so that the receivercan reassemble the bytes intheir original order.

    This way, if TCP segments arriveout of order, the segments willstill be assembled correctly.

    These sequencing numbers alsoact as reference numbers so

    that the receiver will know if ithas received all of the data.

    They also identify the missingdata pieces to the sender so itcan retransmit the missing data.

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    24/35

    Ashis Talukder, Assistant Professor,MIS, DU. 24

    Windowing & Window Size This offers increased efficiency

    since the sender only needs toresend the missing segmentsinstead of the entire set of data.

    Each TCP segment is numbered

    before transmission. The sequence number portion

    comes after the destination portin the segment format.

    At the receiving station, TCPuses the sequence numbers to

    reassemble the segments into acomplete message. If a sequence number is missing

    in the series, that segment isretransmitted.

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    25/35

    Ashis Talukder, Assistant Professor,MIS, DU. 25

    UDP

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    26/35

    Ashis Talukder, Assistant Professor,MIS, DU. 26

    UDP UDP provides connectionless,

    unreliable transmission of packetsat Layer 4 of the OSI model.

    Both TCP and UDP use IP as theirLayer 3 protocol.

    In addition, TCP and UDP are usedby various application layerprotocols.

    TCP provides services forapplications such as FTP, HTTP,

    SMTP, and DNS. UDP is the transport layer

    protocol used by DNS, TFTP,SNMP, and DHCP.

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    27/35

    Ashis Talukder, Assistant Professor,MIS, DU. 27

    UDP TCP must be used

    when applications need toguarantee that a packet arrivesintact, in sequence, andunduplicated.

    The overhead necessary to ensuredelivery of a packet is sometimesa problem with TCP.

    Not all applications need to guaranteedelivery of the data packet, so theyuse the faster, connectionless delivery

    mechanism afforded by UDP.

    UDP does not use windowing or ACKsso application layer protocols mustprovide error detection.

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    28/35

    Ashis Talukder, Assistant Professor,MIS, DU. 28

    Port Number

    Port numbers are used to keep track ofdifferent conversations that cross the networkat the same time.

    Port numbers are needed when a hostcommunicates with a server that uses multipleservices.

    Both TCP and UDP use port numbers to pass

    information to the upper layers. Software developers use the well-known port

    numbers defined in RFC1700.

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    29/35

    Ashis Talukder, Assistant Professor,MIS, DU.

    29

    Port Number

    Conversations that do not involve applicationswith well-known port numbers are assignedport numbers that have been randomlyselected from a specific range.

    Port numbers have the following ranges:

    The Well Known Ports: from 0 through 1023

    The Registered Ports: from 1024 through 49151 The Dynamic and/or Private Ports: from 49152 through 65535

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    30/35

    Ashis Talukder, Assistant Professor,MIS, DU.

    30

    Multiple Conversation At any given moment, thousands of packets destined for

    hundreds of different services travel through a network.

    Servers provide services for a multitude of differentrequests. This causes unique problems for addressing ofpackets.

    For example, if a server uses SMTP and WWW services, aclient cannot construct a packet that is destined for justthe IP address of the server with TCP because both SMTPand WWW use TCP as their transport layer protocol.

    A port number must be associated with the conversation

    to ensure that the packet reaches the appropriateservice.

    Port numbers are used to keep track of differentconversations that cross the network at the same time.

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    31/35

    Ashis Talukder, Assistant Professor,MIS, DU.

    31

    Multiple Conversation A port number must be associated with the conversation

    to ensure that the packet reaches the appropriateservice.

    The source and destination port numbers combinewith the network address to form a socket.

    A pair of sockets, one on each host, forms a uniqueconnection. For instance, a host might have a Telnet connection

    through port 23 and an Internet connection through port80.

    The IP and the MAC addresses would be the same

    because the packets are received from the same host. Therefore, each conversation on the source side needs

    its own port number, and each service requested needsits own port number.

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    32/35

    Ashis Talukder, Assistant Professor,MIS, DU.

    32

    ???

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    33/35

    Ashis Talukder, Assistant Professor,MIS, DU.

    33

    Next Class

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    34/35

    Ashis Talukder, Assistant Professor,MIS, DU.

    34

    IP Shortage & Subnetting

    IP Shortage

    Remedy of IP shortage

    Subnetting

    VLSM CIDR

    Private & Public IP

    NAT, PAT

    Concept of Subnet Subnet Calculation

  • 7/31/2019 Net 13 14 Transport Layer Protocol

    35/35

    Ashis Talukder, Assistant Professor,MIS DU

    35

    Thank You!!!