day16 protocols. tcp “transmission control protocol” –connection oriented very like a phone...

14
Day16 Protocols

Upload: augusta-tate

Post on 01-Jan-2016

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Day16 Protocols. TCP “Transmission Control Protocol” –Connection oriented Very like a phone call, an actual connection is made between the 2 parties

Day16

Protocols

Page 2: Day16 Protocols. TCP “Transmission Control Protocol” –Connection oriented Very like a phone call, an actual connection is made between the 2 parties

TCP• “Transmission Control Protocol”

– Connection oriented • Very like a phone call, an actual

connection is made between the 2 parties.– One part initiates the “call”– Other party must accept it.– At the end, the connection must be

dismantled.

– Robust & Reliable• Error Checking• Timeouts / Retransmission

Page 3: Day16 Protocols. TCP “Transmission Control Protocol” –Connection oriented Very like a phone call, an actual connection is made between the 2 parties

Creating the connection step 1

• Computer 1 sends a packet to computer 2– Contains:

• Initial Sequence Number (Should be random)– For example 1001

• Source Address• Destination Address• Port Number Information

Page 4: Day16 Protocols. TCP “Transmission Control Protocol” –Connection oriented Very like a phone call, an actual connection is made between the 2 parties

Creating the connection step 2

• Computer 2 sends a packet to computer 1– Contains:

• Acknowledgement of receipt of packet 1001• Its Initial Sequence Number (Should also be

random)– For example 5001

• Source Address• Destination Address• Port Number Information

Page 5: Day16 Protocols. TCP “Transmission Control Protocol” –Connection oriented Very like a phone call, an actual connection is made between the 2 parties

Creating the connection step 3

• Computer 1 sends a packet to computer 2– Contains:

• Acknowledgement of receipt of packet 5001

• The next sequence number (1002)• Actual Data

Page 6: Day16 Protocols. TCP “Transmission Control Protocol” –Connection oriented Very like a phone call, an actual connection is made between the 2 parties

Now they are connected• Every packet has a sequence number in

it• In theory every packet must be

acknowledged by the other side– If not, the sender will realize some packets

have never been acknowledged, and will retransmit them (Timeout)

• If a packet is received which is corrupted, the receiver can either specifically report it got a bad packet, or just pretend it never got it at all– Eventually the sender will timeout and re-

send it

Page 7: Day16 Protocols. TCP “Transmission Control Protocol” –Connection oriented Very like a phone call, an actual connection is made between the 2 parties

Many common applications use TCP:

•Web browsers (HTTP)•FTP Clients (FTP)•Mail Clients (POP, IMAP)•Mail Servers (SMTP)•Lotus Notes•Telnet•Databases•etc.

Page 8: Day16 Protocols. TCP “Transmission Control Protocol” –Connection oriented Very like a phone call, an actual connection is made between the 2 parties

UDP• “User Datagram Protocol”

– Packet by packet• No connection is created

– Unreliable• No error checking• No retransmission• Packets often get lost.

– Faster• Without all the overhead of TCP, the

packets are able to flow faster

Page 9: Day16 Protocols. TCP “Transmission Control Protocol” –Connection oriented Very like a phone call, an actual connection is made between the 2 parties

Uses:•Used for most Audio/Video/Games

–Real Audio/Video–Telephony –DNS lookups–Time synchronization programs–VOIP

•Usually used where some data loss is acceptable:

–In Video if you miss one frame, it makes more sense to just forget about it, rather than try to retransmit it.–In audio, often the sample rate is high enough that you can’t hear the difference if a lot is lost.

Page 10: Day16 Protocols. TCP “Transmission Control Protocol” –Connection oriented Very like a phone call, an actual connection is made between the 2 parties

TCP & UDP use port numbers.• Need for ports:

– Since a given workstation could be performing many networking related tasks at once there has to be a way for the OS to determine where to send return data.

– Standardized ports make it simple to find servers on machines.• For example, how does your web browser

know which port to connect to www.cnn.com on?– HTTP servers are usually set up on port 80

Page 11: Day16 Protocols. TCP “Transmission Control Protocol” –Connection oriented Very like a phone call, an actual connection is made between the 2 parties

Some common port numbers:• HTTP80/TCP• telnet 23/TCP• FTP 21/TCP (For the control

connection)• POP 110/TCP• SMTP 25/TCP• DNS 53/UDP (And some TCP)• NTP 123 UDP

* Notice it’s not sufficient to specify a port number, you should also specify which protocol.

Page 12: Day16 Protocols. TCP “Transmission Control Protocol” –Connection oriented Very like a phone call, an actual connection is made between the 2 parties

Some applications use multiple ports

• For example FTP– Port 21/TCP is used to create a

connection between the 2 machines– You login in that connection.– When you request a listing of

documents in a directory, or when you request a file be transferred a new connection is negotiated• The client and server, must negotiate a

free TCP port which the client can accept a connection on from the server

Page 13: Day16 Protocols. TCP “Transmission Control Protocol” –Connection oriented Very like a phone call, an actual connection is made between the 2 parties

Using Protocols• Lets manually get a web page…• Open a telnet connection:

Start – Run – cmdtelnet www.google.com 80

• Once connected type:GET / HTTP/1.0Hit enter twice

Page 14: Day16 Protocols. TCP “Transmission Control Protocol” –Connection oriented Very like a phone call, an actual connection is made between the 2 parties

Emailtelnet student.claytonstate.net 25Helo blaMail from:<your address>Rcpt to:<friends address>Data Hi,

This is a test.