46
CSCI 6433 Class 10 Dave Roberts

Dave Roberts. Dynamic Host Configuration Protocol DHCP Simple Mail Transport Protocol SMTP 2

Embed Size (px)

Citation preview

Page 1: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

CSCI 6433Class 10

Dave Roberts

Page 2: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

2

Agenda

Dynamic Host Configuration Protocol DHCP

Simple Mail Transport Protocol SMTP

Page 3: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

3

DHCPv4: How does a host get started?

Page 4: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

4

What Information Does a Host Need?

Address of default router Network mask Addresses of mail server, DNS server MTU of local network TTL value to use for IP datagrams IP address of host

Page 5: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

5

What About Manual Configuration?

People make mistakes There aren’t enough people Hosts may be dumb and unable to

remember settings

So—we use IP to get the IP addresses that we need. The “limited broadcast” IP address is used to broadcast even before the client knows its own IP address.

Page 6: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

6

Retransmission

Responsibility for reliable communication on the client

Requires that UDP checksum be on Requires that do not fragment bit be

on Client sets timeout, retransmits when

timeout expires Delay has a random number added After failure, delay is doubled, up to 60

seconds

Page 7: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

7

Message Format

Page 8: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

8

Address Allocation Methods

Manual allocation: Each IP address is allocated to a single device. DHCP communicates that address

Automatic allocation: DHCP automatically assigns an IP address permanently to a device, selecting from a pool

Dynamic allocation: DHCP assigns an IP address from a pool for a time chosen by the server or until the client gives it up (most used, by far)

Page 9: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

9

DHCP Lease Length

DHCP administrator must pick lease length for IP addresses Short lease lengths make most effective

use of IP addresses Long lease lengths produce more

network stability Lease lengths might be from one hour to

months

Page 10: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

10

DHCP Lease Allocation Process

Page 11: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

11

Summary

DHCPv4 is run by hosts at startup It configures the host for network

operation

What about v6?

Page 12: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

12

Startup with IPv6

Designers wanted startup without DHCP

Designed stateless autoconfiguration But ISPs and network managers

wanted more control, so DHCPv6 was also developed

Page 13: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

13

DHCPv6

Server for each network; host contacts server

Host generates link-local address, uses link-local multicast to reach server

DHCPv6 allows for authentication RFC for DHCPv6 is twice the size as

RFC for DHCPv4

Page 14: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

14

Stateless Autoconfiguration

Uses IPv6 Neighbor Discovery Protocol (NDP)

Host generates an IPv6 address and checks its uniqueness on its network

Link-local address generated with prefix in leftmost bits and MAC address in rightmost bits. Any in between are set to zero.

Host uses Duplicate Address Detection (DAD) to test whether the link-local address s unique on the subnet

Page 15: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

15

Duplicate Address Detection Host sends neighbor solicitation message

asking for address it wants to use If other host is using it, it responds and

requesting host stops autoconfiguration This rarely happens because MAC

addresses are intended to be unique Next, host sends router solicitation

message to all-routers multicast address Response from router tells host whether to

use DHCP, whether to create global address

Page 16: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

16

NDP

Router Discovery Next-hop routes Neighbor discovery Neighbor

unreachability detection

Address prefix discovery

Configuration parameter discovery

Stateless autoconfiguration

Duplicate address detection

Address resolution DNS server

discovery Redirect

Page 17: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

17

ICMPv6 Message Types for NDP

Router Solicitation Router Advertisement Neighbor Solicitation Neighbor Advertisement Redirect

Page 18: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

18

ICMPv6 Router Solicitation

Page 19: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

19

ICMPv6 Router Advertisement

Page 20: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

20

ICMPv6 Neighbor Solicitation

Page 21: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

21

ICMPv6 Neighbor Advertisement

Page 22: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

22

ICMPv6 Redirect

Page 23: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

23

Summary

For IPv6, configurations can be managed by DHCP or automatically

Either method can provide all the parameters needed on startup

DHCP allows for more complete control of which hosts can connect to a network

Page 24: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

Electronic mail

24

Page 25: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

Electronic Mail

Email allows users to send memos across the Internet.

Notes can be short or quite large Notes can have multiple

attachments Must work when remote machine is

unreachable

25

Page 26: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

Actors in the Email System

Post Office SMTP servers move email between each

other SMTP servers store email for delivery to

end users Users

POP clients pick up email from SMTP servers

POP clients hand outgoing mail to SMTP servers

26

Page 27: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

27

Components

Page 28: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

Delayed Delivery

28

Sender and receiver do not need to be connected to the server at the same time

Page 29: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

29

An SMTP Transaction

MAIL command: establishes return address and bounce address

RCPT command: establishes recipient of this message

DATA signals beginning of the message text

Page 30: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

30

Questions

What protocol do SMTP servers use to deliver messages?

How does SMTP differ between v4 and v6?

Page 31: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

SMTP Transaction Sequence

31

Page 32: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

32

Example

S: 220 smtp.example.com ESMTP Postfix C: HELO relay.example.org S: 250 Hello relay.example.org, I am glad to meet you C: MAIL FROM:<[email protected]> S: 250 Ok C: RCPT TO:<[email protected]> S: 250 Ok C: RCPT TO:<[email protected]> S: 250 Ok C: DATA S: 354 End data with <CR><LF>.<CR><LF> C: From: "Bob Example" <[email protected]> C: To: "Alice Example" <[email protected]> C: Cc: [email protected] C: Date: Tue, 15 January 2008 16:02:43 -0500 C: Subject: Test message C: C: Hello Alice. C: This is a test message with 5 header fields and 4 lines in the message body. C: Your friend, C: Bob C: . S: 250 Ok: queued as 12345 C: QUIT S: 221 Bye {The server closes the connection}

Page 33: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

Alias Expansion, Mail Forwarding

33

Page 34: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

Internetworking and Email

TCP/IP internet makes universal delivery service possible

Mail systems built on TCP/IP are inherently reliable because of end-to-end delivery

Alternatively, mail gateways are used Allow mail transfer between different systems When gateway has a message, sender discards

it

34

Question: Is email through a gateway better or worse than a direct SMTP transfer?

Page 35: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

TCP/IP Email Standards

Format and computer interaction are specified separately

Format: header, blank line, body Body unspecified Header is key word, colon, value Some keywords required, others

optional Header is readable

35

Page 36: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

Email Addresses

local-part @ domain-name

domain-name: name of mail destination

local-part: address of a mailbox at destination

Note: when gateways are employed, mail addresses are site-dependent

36

Page 37: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

SMTP

Simple Mail Transport Protocol Focuses on how mail delivery system

passes messages from one machine to a server on another machine

Does not specify anything about user interface

Does not specify how mail is stored

37

Page 38: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

Assured Delivery

SMTP server forms TCP/IP connection with receiving server

Once receiving server has put message into safe store, then it acknowledges and sender discards message

If SMTP can’t transfer message on the first try, it keeps trying

After several days of failure, SMTP reports failure to deliver.

38

Page 39: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

SMTP Highlights

All communications is readable ASCII text

Transcript of interactions is readable Each message is acknowledged

separately Addresses of the form local-

part@domain-name

39

Page 40: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

Mail Retrieval and Mailbox Manipulation

POP3—Post Office Protocol POP3 client creates TCP connection to

POP3 server on mailbox computer Mailbox computer runs two servers:

SMTP to place mail into user mailboxes POP3 server to allow user to extract messages

from user mailbox POP3 retrieves messages, deletes from

user mailbox Two servers must coordinate use of the

user mailbox

40

Page 41: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

Internet Message Access Protocol

POP stores messages offline; not compatible with the use of multiple computers

IMAP allows message access, manipulation from multiple computers

Platform-independent access to mail

41

Question: How does server resource usage of IMAP compare with POP?

Page 42: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

MIME Extension for Non-ASCII Data

MIME—Multipurpose Internet Mail Extensions

Defined to allow transmission of non-ASCII data through mail

MIME allows arbitrary data to be encoded in ASCII, transmitted as standard email message

MIME message tells recipient type of data, type of encoding used

Data type and subtype is specified MIME information is in 822 mail header

42

Page 43: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

MIME Content Types

43

Page 44: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

MIME Example

From: [email protected]: [email protected]: 1/0Content-Type: image/gifContent-Transfer Encoding: base64

….data for the image….

44

Page 45: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

Mail Retrieval, Mailbox Protocols

Post Office Protocol—client login with userid/password

Client can then retrieve, delete messages

Server computer must run two servers: POP and SMTP

POP and SMTP must coordinate use of mailbox

45

Page 46: Dave Roberts.  Dynamic Host Configuration Protocol  DHCP  Simple Mail Transport Protocol  SMTP 2

Summary

Email is a very important Internet service Separate standards are used for message format

and transfer SMTP—how a mail system on one machine

transfers to a server on another POP3—how a user can retrieve contents of a

mailbox IMAP—user protocol for use from multiple

computers MIME allows arbitrary data to be exchanged using

SMTP

46