lecture 11 overview. router architecture overview two key router functions: – run routing...

53
Lecture 11 Overview

Upload: sara-king

Post on 19-Jan-2016

224 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Lecture 11 Overview

Page 2: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Router Architecture Overview• Two key router functions:

– run routing algorithms/protocol (RIP, OSPF, BGP)– forwarding datagrams from incoming to outgoing link

CPE 401/601 Lecture 11 : Router Architectures 2

Page 3: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Input Port Functions

• Goal: complete input port processing at ‘line speed’

CPE 401/601 Lecture 11 : Router Architectures 3

Physical layer:bit-level reception

Data link layer:e.g., Ethernet

Network layer:Routing & forwarding

Page 4: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Input Port Queuing• Queuing when datagrams arrive faster than

forwarding rate into switch fabric• queuing delay and loss due to input buffer overflow!• Head-of-the-Line (HOL) blocking: queued datagram

at front of queue prevents others in queue from moving forward

CPE 401/601 Lecture 11 : Router Architectures 4

Page 5: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Three types of switching fabrics

CPE 401/601 Lecture 11 : Router Architectures 5

Page 6: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Output Ports

• Buffering required when datagrams arrive from fabric faster than the transmission rate

• Queuing: Scheduling discipline chooses among queued datagrams for transmission

CPE 401/601 Lecture 11 : Router Architectures 6

Page 7: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

How much buffering?

• RFC 3439 rule of thumb: – buffering equal to typical RTT (say 250 msec)

times link capacity C• e.g., C = 10 Gps link:

– 2.5 Gbit buffer

• Recent recommendation: – with N flows, buffering equal to

RTT C.N

CPE 401/601 Lecture 11 : Router Architectures 7

Page 8: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Bridge Software

• A bridge connects networks and forwards frames from one network to another.

8

BRIDGE

A B

C D

E F

G H

PORTSPORTS

CPE 401/601 Lecture 11 : Bridges

Page 9: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Selective Forwarding

• If A sends a frame to E– the frame must be forwarded by the bridge

• If A sends a frame to B– there is no reason to forward the frame

9

BRIDGE

A B

C D

E F

G H

CPE 401/601 Lecture 11 : Bridges

Page 10: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Bridge Database

• The bridge needs a database that contains information about which hosts are on which network.

• The realistic options are:– The system administrator can create and maintain

the database. – The bridge can acquire the database on the fly.

10

Hard to addnew computers

Some loss of efficiency

CPE 401/601 Lecture 11 : Bridges

Page 11: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Learning the host mapping

• Bridge forwards packets whose destination network is unknown

• Every time bridge forwards a packet it can record the network on which the sender is

• Each host mapping expires when it is unused for a “long” period of time

• New hosts can be added at any time• Requires no setup information from humans• A host can be moved to another network

11CPE 401/601 Lecture 11 : Bridges

Page 12: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

What is the problem ?

12

Bridge 1 10

Bridge 2 10

A

C

B

D

F

E

CPE 401/601 Lecture 11 : Bridges

Page 13: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Possible Solutions

• Forget about smart bridges

• Tell customers to avoid topologies that include loops– design bridges so that they detect loops and

scream at the customer

• Design bridges that prune the network topology into something with no loops.

13CPE 401/601 Lecture 11 : Bridges

Page 14: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Spanning Tree Creation

• The bridges must communicate!– They send configuration bridge protocol data units

(BPDUs)– Multicast: special data link address

• Each bridge has a unique ID

• Use an algorithm to construct a spanning tree based on local messages

14CPE 401/601 Lecture 11 : Bridges

Page 15: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Spanning Tree

15

B

BB

B

B

B

B

BB

B

B

B

Prune

B bridge networkCPE 401/601 Lecture 11 : Bridges

Page 16: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Lecture 12

Telnet and E-mail Protocols

CPE 401 / 601

Computer Network Systems

slides are modified from Dave Hollingerslides are modified from Dave Hollinger

Page 17: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

TELNET

• TELNET is a protocol that provides– general, – bi-directional, – eight-bit byte oriented communications

• Over TCP connection– data and control over the same connection

• Many application protocols are built upon the TELNET protocol

• Used to test HTTP, FTP, SMTP, POP3, IRC, etc.CPE 401/601 Lecture 12 : TELNET protocol 17

Page 18: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Network Virtual Terminal

• intermediate representation of a generic terminal

• provides a standard language for communication of terminal control functions

CPE 401/601 Lecture 12 : TELNET protocol 18

NVT NVT

ServerProcess

TCP TCP

Page 19: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Negotiated Options• All NVTs support a minimal set of capabilities

– Some terminals have more capabilities

• Set of options is not part of TELNET protocol– so that new terminal features can be incorporated

without changing the TELNET protocol

• Two endpoints negotiate a set of mutually acceptable options– Line mode vs. character mode– echo modes– character set (EBCDIC vs. ASCII)

19CPE 401/601 Lecture 12 : TELNET protocol

Page 20: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Control Functions

• TELNET includes support for a series of control functions commonly supported by servers

• This provides a uniform mechanism for communication of (the supported) control functions

20CPE 401/601 Lecture 12 : TELNET protocol

Page 21: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Control Functions• Interrupt Process (IP)

– suspend/abort process

• Abort Output (AO)– send no more output to user’s terminal

• Are You There (AYT)– check to see if system is still running

• Erase Character (EC)– delete last character sent

• Erase Line (EL)– delete all input in current line

21CPE 401/601 Lecture 12 : TELNET protocol

Page 22: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Command Structure• Commands start with a special character called

the Interpret as Command escape character– The IAC code is 255– If a 255 is sent as data, it must be followed by

another 255• If IAC is found and the next byte is IAC

– a single byte is presented to application/terminal • If IAC is followed by any other code

– the TELNET layer interprets this as a command

22CPE 401/601 Lecture 12 : TELNET protocol

Page 23: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Playing with TELNET• telnet is a generic TCP client

– Sends whatever you type to the TCP socket– Prints whatever comes back through the TCP socket– Useful for testing TCP servers

• ASCII based protocols

• Many Unix systems have these servers running (by default):– echo port 7 discard port 9– daytime port 13 chargen port 19

23CPE 401/601 Lecture 12 : TELNET protocol

Page 24: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

telnet hostname port> telnet amele-2.cse.unr.edu 7Trying 134.197.40.246...Connected to amele-2.cse.unr.edu (134.197.40.246).

Escape character is '^]'.Hi mehmetHi mehmetstop itstop it^]telnet> quitConnection closed.

24CPE 401/601 Lecture 12 : TELNET protocol

Page 25: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

E-mail Protocols

Page 26: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Email

• SMTP - Simple Mail Transfer Protocol– 1982 (RFC 821, 5321, …)

• POP - Post Office Protocol (v3)– 1984 (RFC 1939 , …)

• IMAP (v4)– 1986 (RFC 1730, 3501 , …)

• MIME extensions– 1992 (RFCs 1521, 1522 , …)

26CPE 401/601 Lecture 12 : E-mail protocols

Page 27: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

A Typical Mail Environment

Internet

Mail Server

POPStore

IMAPstore

Mail Server

MailClient

MailClient

SMTP

POP

IMAP

SMTP

SMTP

Interactive Mail Access Protocol

27CPE 401/601 Lecture 12 : E-mail protocols

Page 28: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Terminology

• User Agent– end-user mail program

• Message Transfer Agent– responsible for communicating with remote hosts

and transmitting/receiving email• both a client and server

• Mail Exchanger– host that takes care of email for a domain

28CPE 401/601 Lecture 12 : E-mail protocols

Page 29: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

SMTP

• Used to exchange mail messages between mail servers (Message Transfer Agents)

29

MTAMTA MTAMTA

UAUA

SMTP

FileSystem

FileSystem

MTAMTASMTP

UAUA

CPE 401/601 Lecture 12 : E-mail protocols - SMTP

Page 30: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

SMTP Protocol

• SMTP sender is the client• SMTP receiver is the server• Alternating dialogue:

– client sends command and server responds with command status message

– Order of the commands is important!– Status messages include

• ASCII encoded numeric status code (like HTTP,FTP) and • text string

30CPE 401/601 Lecture 12 : E-mail protocols - SMTP

Page 31: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

SMTP Commands• HELO

– identifies sender

• MAIL FROM:– starts mail transaction and identifies mail originator

• RCPT TO:– identifies individual recipient– there may be multiple RCPT TO: commands

• DATA – sender ready to transmit a series of lines of text, each ends

with ‘\r\n’– A line containing only a period ‘.’ indicates end of the data

31CPE 401/601 Lecture 12 : E-mail protocols - SMTP

Page 32: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Data Format

• ASCII only– must convert binary to an ASCII representation to

send via email

• What if we want to send a line containing only a period?– Sender prepends a period to any line staring with

a period (in the message)– Receiver strips the leading period in any line that

starts with a period and has more stuff32CPE 401/601 Lecture 12 : E-mail protocols - SMTP

Page 33: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Message Progress

TCP Connection Establishment

TCP Connection Termination

Page 34: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Typical Exchange> telnet mail.cse.unr.edu 25Trying 134.197.40.1...Connected to mail.cse.unr.edu.Escape character is '^]'.220 ponderosa.cse.unr.edu ESMTP PostfixHELO cse.unr.edu250 ponderosa.cse.unr.eduMAIL FROM: [email protected] 2.1.0 OkRCPT TO: mgunes250 2.1.5 OkDATA354 End data with <CR><LF>.<CR><LF>Hi Mehmet.250 2.0.0 Ok: queued as C0D242F8D9

34CPE 401/601 Lecture 12 : E-mail protocols - SMTP

Page 35: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Leading PeriodDATA

354 Enter mail, end with "." on a line by itself

Hi Mehmet - this message is a test of SMTP

..

..foo

..

.

250 2.0.0 Ok: queued as VAA0771

Resulting Message:

35

Hi Mehmet - this message is a test of SMTP..foo

Hi Mehmet - this message is a test of SMTP..foo

CPE 401/601 Lecture 12 : E-mail protocols - SMTP

Page 36: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Reply Codes

• Contain a Lot of Information

• Only the reply codes count– Other information in a reply is purely for humans

354The first digit

indicates success, failure,

or incomplete

The second digit is the category of error message

The third digit is the specific message for that

category

Page 37: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Other SMTP Commands

• VRFY – confirm that a name is a valid recipient

• EXPN – expand an alias (group email address)

• TURN – switch roles (sender <=> receiver)

• NOOP – send back a positive reply code

37CPE 401/601 Lecture 12 : E-mail protocols - SMTP

Page 38: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Other SMTP Commands

• SOML – Send Or Mail

• if recipient is logged in, display message on terminal, otherwise email

• SAML– Send and Mail

• RSET – abort current transaction

38CPE 401/601 Lecture 12 : E-mail protocols - SMTP

Page 39: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

SMTP Extensions (EHLO)• A mailer supporting extensions uses EHLO

instead of HELO in the greeting

TCP / IP model 39

$ telnet mail.unr.edu 25Trying 134.197.1.112...

220 smtp.unr.edu ESMTP PostfixEHLO250-smtp.unr.edu250-PIPELINING250-SIZE 30720000250-VRFY250-ENHANCEDSTATUSCODES250-8BITMIME250 DNS

A mailer that supports extensions responds with a list of which ones it can do

A mailer that supports extensions responds with a list of which ones it can do

Page 40: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Mail Headers

• Email messages contain many headers– some headers are created by the UA– some are automatically added by the MTA

• Every MTA adds (at least) a “Received:” header

• Some of the headers are parsed by intermediate MTAs– but the message content is ignored and passed on

transparently

40CPE 401/601 Lecture 12 : E-mail protocols - SMTP

Page 41: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Multipurpose Internet Mail Extensions

• Defines extensions to support binary attachments of arbitrary format– Images, Audio, Video and multi-media messages– Text having unlimited line length or overall length– Multiple objects in a single message– Character sets other than ASCII– Multi-font messages

• Requires more capable UAs to interpret messages

CPE 401/601 Lecture 12 : E-mail protocols - MIME 41

Page 42: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

A sample MIME messageFrom: [email protected] (Jan Trumbo)

Subject: small message with Word attachment

To: [email protected]

MIME-version: 1.0

Content-type: MULTIPART/MIXED; BOUNDARY="Boundary_[ID_nf99lkyavAuSoClF/HeK0Q]"

--Boundary_[ID_nf99lkyavAuSoClF/HeK0Q]

Content-type: text/plain; charset=us-ascii

Joel, attached is a Word document. - Jan

--Boundary_[ID_nf99lkyavAuSoClF/HeK0Q]

Date: Thu, 19 Sep 1996 16:49:52 -0700

Content-type: application/mac-binhex40; name=tiny_text_Word_doc.doc

Content-disposition: attachment; filename=tiny_text_Word_doc.doc

<Word document and more stuff below here>

This identical boundary marker separates the parts of the mail message

42CPE 401/601 Lecture 12 : E-mail protocols - MIME

Page 43: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Pulling Emails• Offline (POP3 model)

– Client connects to server and pulls all email down to client– Everything is stored on the client

• Online (Original IMAP model)– Client connects to server for every transaction– Everything is stored on the server

• Disconnected (Later IMAP model)– Client and server share storage burden– Server is always authoritative and client must synchronize

to server

43CPE 401/601 Lecture 12 : E-mail protocols

Page 44: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

POP – Post Office Protocol

• Used to transfer mail from a mail server to a User Agent

44

MailServer

MailServer UAUA

FileSystem

FileSystem

POP

CPE 401/601 Lecture 12 : E-mail protocols - POP3

Page 45: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

POP (version 3)

• Similar to SMTP command/reply lockstep• Minimizes server resources• Used to retrieve mail for a single user

– requires authentication

• Commands and replies are ASCII lines– Replies start with “+OK” or “-ERR”– Replies may contain multiple lines

• POP has no security– Except when used with SSL, TLS

45CPE 401/601 Lecture 12 : E-mail protocols - POP3

Page 46: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

POP-3 Commands• USER

– specify username

• PASS – specify password

• STAT – get mailbox status– number of messages in the mailbox and their size

• LIST – get a list of messages and sizes– One per line, termination line contains ‘.’ only

46CPE 401/601 Lecture 12 : E-mail protocols - POP3

Page 47: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

More POP-3 Commands• RETR

– retrieve a message

• DELE– mark a message for deletion from the mailbox

• NOOP – send back positive reply

• RSET– All deletion marks are unmarked

• QUIT – remove marked messages and close connection

47CPE 401/601 Lecture 12 : E-mail protocols - POP3

Page 48: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Optional Commands

• TOP – send header lines from messages

• APOP – alternative authentication

• message digest based on opening greeting sent from POP server

• Requires shared secret!• No cleartext password on the network• Does not authenticate the server!!!!

48CPE 401/601 Lecture 12 : E-mail protocols - POP3

Page 49: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

A POP3 Exchange> telnet monte pop3Trying 128.213.8.110...Connected to monte.cs.rpi.edu (128.213.8.110).Escape character is '^]'.+OK POP3 monte.cs.rpi.edu v7.59 server readyuser joe+OK User name accepted, password pleasepass joepw+OK Mailbox open, 1 messagesstat+OK 1 412list+OK Mailbox scan listing follows1 412.

49CPE 401/601 Lecture 12 : E-mail protocols - POP3

Page 50: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

POP3 Example Continuedretr 1+OK 412 octetsReturn-Path: <hollingd>Received: (from hollingd@localhost) by monte.cs.rpi.edu (8.9.3/8.9.3) id

NAA06943 for joe; Mon, 20 Mar 2000 13:49:54 -0500Date: Mon, 20 Mar 2000 13:49:54 -0500From: Dave Hollinger <[email protected]>Message-Id: <[email protected]>To: [email protected]: O

blah.

50CPE 401/601 Lecture 12 : E-mail protocols - POP3

Page 51: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

Internet Message Access Protocol

• On-line, off-line, or disconnected mode operation

• Server-side Mailbox Manipulation– Multiple mailbox support– Control of all folders everywhere

• Online performance optimization– User can check email header or search a string

before downloading

• Real authentication

CPE 401/601 Lecture 12 : E-mail protocols - IMAP 51

Page 52: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

All Messages

POP3:

IMAP:Dr.Amer

Friends

….headers

Whole message

Internet

Internet

POP vs. IMAP

Page 53: Lecture 11 Overview. Router Architecture Overview Two key router functions: – run routing algorithms/protocol (RIP, OSPF, BGP) – forwarding datagrams

WebMail

• Web-base email access• User agent -> web browser• User agent-mail server communication based

on HTTP– HTTP to send messages from user to the mail

server of the user– HTTP to get mail from the mail server of the

destination

TCP / IP model 53