Tcp ip lecture 2
Download
1 / 43

e 2 - PowerPoint PPT Presentation


  • 265 Views
  • Updated On :

TCP/IP Lecture 2 cs193i – Internet Technologies Summer 2004 Stanford University Announcements Lab #1 due Wednesday HW #1 assigned Extra perl session tomorrow Tuesday, June 29, 2:15-3:05pm, Skilling 193 Broadcast live on E2, Stanford Online

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'e 2' - Thomas


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Tcp ip lecture 2 l.jpg

TCP/IPLecture 2

cs193i – Internet Technologies

Summer 2004

Stanford University


Announcements l.jpg
Announcements

  • Lab #1 due Wednesday

  • HW #1 assigned

  • Extra perl session tomorrow

    • Tuesday, June 29, 2:15-3:05pm, Skilling 193

    • Broadcast live on E2, Stanford Online

  • Silas’ Thursday office hours moved to Wednesday this week

    • Sweet Hall, 6:30-8:30pm



Local area network lan l.jpg
Local Area Network (LAN)

  • High speed, data network over small region

    • Few thousand meters

  • Network technologies:

    • Ethernet

    • FDDI

    • Token ring

  • Data link layer

    • Packets routed based on physical address (MAC)

LAN 1

LAN 2


Local area network lan5 l.jpg
Local Area Network (LAN)

  • High speed, data network over small region

    • Few thousand meters

  • Network technologies:

    • Ethernet

    • FDDI

    • Token ring

  • Data link layer

    • Packets routed based on physical address (MAC)

LAN 1

?

LAN 2


Connecting below internet level l.jpg
Connecting Below Internet Level

  • Hub

    • Center of star topology

    • In Ethernet, multiport repeater or concentrator

  • Bridge

    • Connects 2 networks of same technology – extended LAN

    • Filters/forwards/floods based on MAC

    • Link layer - frames

  • Switch

    • Connects 2+ networks – packet-switched network

    • Reduces collisions

Hub

Bridge

Switch


Connecting at the internet level l.jpg
Connecting at the Internet Level

  • Router

    • Originally gateway

    • Forwards packets based on network layer info (IP)

    • Separate broadcast domains

    • In each domain, IP packet encapsulated in domain-specific packet

Router


Internet society l.jpg
Internet Society

  • Governing body for Internet since 1992

    • http://www.isoc.org

  • Domain names and addresses assigned

    • Upper level: Internet Assigned Numbers Authority

    • Regional:

      • Latin America / Caribbean

      • Asia Pacific

      • America

      • Europe


How does everyone work together l.jpg
How Does Everyone Work Together?

  • Networks

    • MCI Worldcom, Sprint, Earthlink, …

    • Exchange points provide connections between networks

    • Network Access Points – open access policies

  • Network Service Provider

    • Build national or global networks

    • Lease space at NAPs

    • Sell bandwidth to regional NSPs

    • Regional NSP sell bandwidth to ISP

  • Internet Service Provider sells bandwidth to end users



Osi reference model for network design l.jpg
OSI Reference Model for Network Design

Application (Layer 7)

Presentation

Session

Transport

Network

Data Link

Physical (Layer 1)


Osi vs tcp ip stack l.jpg

Layering: FTP Example

Application

FTP

Application

Presentation

ASCII/Binary

Session

Transport

TCP

Transport

Network

Network

IP

Link

Link

Ethernet

Physical

The 4-layer Internet model

The 7-layer OSI Model

OSI vs. TCP/IP Stack



Ip datagram l.jpg

Header

10101011101010101010010101010100101010100

11010010101010010101111111010000011101111

10100001011101010100110101011110100000101

00100000000010101000011010000111111010101

......... 1011011001010100011001001010110

Data

IP Datagram


Ip addresses l.jpg

A

B

C

0 nethost

1 0net host

110nethost

1724 bits

21416 bits

3218 bits

IP Addresses

  • 4 8-bit numbers (Hierarchical)

  • Specifies both network and host

  • Number of bits allocated to specify network varies

  • Three classes:

18.26.0.1

host

network

32-bits


Ip addresses16 l.jpg
IP Addresses

  • IP (Version 4) Addresses are 32 bits long

  • IP Addresses Assigned Statically or Dynamically (DHCP)

  • IPv6 addresses are 128 bits long


Ip address space l.jpg
IP Address Space

  • Originally, 3 Classes

    • A, B, C

  • Problem

    • Classes too rigid (C too small, B too big)

  • Solution

    • Subnetting (e.g. within Stanford)

    • Classless Interdomain Routing (CIDR)


Subnetting l.jpg
Subnetting

  • IP Address plus subnet mask (netmask)

  • IP Addr: 171.64.15.82Netmask: 0xFFFFFF00 (111...1100000000)

    • First 24 bits are the Subnet ID (the neighborhood)

    • Last 8 bits are Host ID (the street address)

  • Can be written as “Prefix + Length”

    • 171.64.15.0/24 or 171.64.15/24



Ip routing l.jpg
IP Routing

  • Routers are not omniscient

    • Next-Hop

  • Hop-by-Hop

  • Thus IP makes no guarantees

    • except to try it’s best (”Best Effort”)

    • packets may get there out of order, garbled, duplicated

    • may not get there at all!

    • Unreliable datagram service


Ip routing hop by hop l.jpg
IP Routing Hop-by-Hop

How a Router Forwards Datagrams


Classless interdomain routing cidr l.jpg

232-1

0

Classless Interdomain Routing (CIDR)


Classless interdomain routing cidr23 l.jpg

128.9.0.0

142.12/19

65/8

128.9/16

0

2

-1

32

2

16

128.9.16.14

Classless Interdomain Routing (CIDR)


Classless interdomain routing cidr24 l.jpg

128.9.19/24

128.9.25/24

128.9.16/20

128.9.176/20

128.9/16

0

2

-1

32

128.9.16.14

Classless Interdomain Routing (CIDR)


Classless interdomain routing cidr25 l.jpg

128.9.19/24

128.9.25/24

128.9.16/20

128.9.176/20

128.9/16

0

2

-1

32

128.9.16.14

Classless Interdomain Routing (CIDR)



Network programs l.jpg
Network Programs

  • host

  • ping

  • traceroute

  • nslookup


Summary of ip l.jpg
Summary of IP

  • Connectionless/Datagram

  • Unreliable/Best Effort



Characteristics l.jpg
Characteristics

  • Connection-Oriented

  • Reliable

  • Byte-Stream

  • Flow Control (aka Congestion Control)


Three phases l.jpg
Three Phases

  • Establish Connection

  • Data Transfer

  • Terminate Connection



Data transfer l.jpg

Host A

Byte 0

Byte 1

Byte 2

Byte 3

Byte 80

Host B

Byte 0

Byte 1

Byte 2

Byte 3

Byte 80

Data Transfer


Data transfer34 l.jpg

Host A

Byte 0

Byte 1

Byte 2

Byte 3

Byte 80

TCP Data

TCP Data

Host B

Byte 0

Byte 1

Byte 2

Byte 3

Byte 80

Data Transfer


Maintaining the connection l.jpg

IP Data

IP

Hdr

TCP Data

TCP

Hdr

0

15

31

Src

port

Dst port

Sequence #

Src

/dst port numbers

Ack

Sequence #

and IP addresses

Flags

Window Size

RSVD

HLEN

uniquely identify socket

PSH

SYN

URG

RST

ACK

FIN

6

4

Checksum

Urg

Pointer

(TCP Options)

TCP Data

Maintaining the “Connection”


Terminating the connection l.jpg

(Active)

(Passive)

Client

Server

Fin

(Data +)

Ack

Fin

Ack

Connection Close/Teardown

2 x 2-way handshake

Terminating the Connection


Slide37 l.jpg


Reliability flow control l.jpg
Reliability & Flow Control

  • Sequence numbers & Acknowledgements (ACKs)

    • Receiver detects Corrupt, Lost, Duplicated, Out-of-order

    • Tell sender which packets it has received correctly

    • Sender can resend

  • In Flight Window (Window Size)

    • Sender only has N unacknowledged packets “in


Sending a message l.jpg

Arachne

.

Berkeley

.edu

Leland.Stanford.edu

Application Layer

Leslie

Ron

Transport Layer

O.S.

O.S.

Data

Header

Data

Header

Network Layer

D

H

D

H

D

H

D

H

D

H

Link Layer

D

H

Sending a Message


Slide40 l.jpg



User datagram protocol udp l.jpg
User Datagram Protocol (UDP)

  • Like TCP, in the Transport Layer

  • Characteristics

    • Connectionless, Datagram, Unreliable

  • Adds only application multiplexing/demultiplexing and checksumming to IP

  • Good for Streaming Media, Real-time Multiplayer Networked Games, VoIP


Summary l.jpg
Summary

  • IP is the basis of Internetworking

  • TCP builds on top of IPadds reliable, congestion-controlled, connection-oriented byte-stream.

  • UDP builds on top of IPallows access to IP functionality


ad