1 tcp/ip introduction ผศ. ดร. อนันต์ ผลเพิ่ม anan phonphoem, ph.d....

32
1 TCP/IP introduction ผผ.ผผ. ผผผผผผ ผผผผผผผ Anan Phonphoem, Ph.D. [email protected] http://www.cpe.ku.ac.th/~anan Computer Engineering Department Kasetsart University, Bangkok, Thailand

Upload: shauna-owen

Post on 25-Dec-2015

250 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: 1 TCP/IP introduction ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem, Ph.D. anan@cpe.ku.ac.th anan Computer Engineering Department Kasetsart

1

TCP/IP introduction

ผศ.ดร. อนั�นัต์ ผลเพิ่ �มAnan Phonphoem, Ph.D.

[email protected]

http://www.cpe.ku.ac.th/~anan

Computer Engineering Department

Kasetsart University, Bangkok, Thailand

Page 2: 1 TCP/IP introduction ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem, Ph.D. anan@cpe.ku.ac.th anan Computer Engineering Department Kasetsart

2

Outline TCP/IP Overview IP Address Subnet Design

Page 3: 1 TCP/IP introduction ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem, Ph.D. anan@cpe.ku.ac.th anan Computer Engineering Department Kasetsart

3

An Internet according to TCP/IP

Page 4: 1 TCP/IP introduction ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem, Ph.D. anan@cpe.ku.ac.th anan Computer Engineering Department Kasetsart

4

OSI Model and TCP/IP7 Application

6 Presentation

5 Session

4 Transport

3 Network

2 Data Link

1 Physical

Applications

TCP/ UDP

IP

Physical

Data Link (Network)

(Transport)

(Internet)

Page 5: 1 TCP/IP introduction ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem, Ph.D. anan@cpe.ku.ac.th anan Computer Engineering Department Kasetsart

5

TCP/IP Layering Concept

Transmission

Network Interface

NetworkApplication

Applications

End-to-endServices

Transport

RoutingInternet

Physical

Network

Page 6: 1 TCP/IP introduction ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem, Ph.D. anan@cpe.ku.ac.th anan Computer Engineering Department Kasetsart

6

TCP/IP Encapsulation

Applications

TCP/ UDP

IP

Physical

Data Link

Message

User Datagram (segment)

Datagram

Frame

Bits

Page 7: 1 TCP/IP introduction ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem, Ph.D. anan@cpe.ku.ac.th anan Computer Engineering Department Kasetsart

7

Data Flow

Hello

1001101001011101011

H Hello

Applications

TCP/ UDP

IP

Physical

Data Link

H HelloH

2 TH HelloH

Page 8: 1 TCP/IP introduction ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem, Ph.D. anan@cpe.ku.ac.th anan Computer Engineering Department Kasetsart

8

UDP Datagram format

Page 9: 1 TCP/IP introduction ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem, Ph.D. anan@cpe.ku.ac.th anan Computer Engineering Department Kasetsart

9

TCP segment format

Page 10: 1 TCP/IP introduction ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem, Ph.D. anan@cpe.ku.ac.th anan Computer Engineering Department Kasetsart

10

IP Datagram

Page 11: 1 TCP/IP introduction ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem, Ph.D. anan@cpe.ku.ac.th anan Computer Engineering Department Kasetsart

11

Ethernet Frame

Destination

Physical Address

(First 6-byte)

Type

2 Bytes

Ethernet Header

00 A0 24 A6 F6 44 00 A0 24 A6 F6 59 08 00

Source

Physical Address

(Second 6-byte)

DataIP

Header

TCP

Header

CRC4 bytes

Page 12: 1 TCP/IP introduction ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem, Ph.D. anan@cpe.ku.ac.th anan Computer Engineering Department Kasetsart

12

Internet

Page 13: 1 TCP/IP introduction ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem, Ph.D. anan@cpe.ku.ac.th anan Computer Engineering Department Kasetsart

13

Data Flow over the Internet

Source DestinationRouter Router

Application

TCP/IP

IP

Data Link

Physical

Application

TCP/IP

IP

Data Link

Physical

IP

Data Link

Physical

IP

Data Link

Physical

Page 14: 1 TCP/IP introduction ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem, Ph.D. anan@cpe.ku.ac.th anan Computer Engineering Department Kasetsart

14

IP Datagram

Page 15: 1 TCP/IP introduction ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem, Ph.D. anan@cpe.ku.ac.th anan Computer Engineering Department Kasetsart

15

Internet Address

Page 16: 1 TCP/IP introduction ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem, Ph.D. anan@cpe.ku.ac.th anan Computer Engineering Department Kasetsart

16

Internet Classes

Classful Addressing

Page 17: 1 TCP/IP introduction ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem, Ph.D. anan@cpe.ku.ac.th anan Computer Engineering Department Kasetsart

17

Internet Classes

Class AClass C

DE

Class B

Page 18: 1 TCP/IP introduction ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem, Ph.D. anan@cpe.ku.ac.th anan Computer Engineering Department Kasetsart

18

IP address in decimal notation

Page 19: 1 TCP/IP introduction ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem, Ph.D. anan@cpe.ku.ac.th anan Computer Engineering Department Kasetsart

19

Class ranges of Internet Address

Page 20: 1 TCP/IP introduction ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem, Ph.D. anan@cpe.ku.ac.th anan Computer Engineering Department Kasetsart

20

Class A example

Page 21: 1 TCP/IP introduction ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem, Ph.D. anan@cpe.ku.ac.th anan Computer Engineering Department Kasetsart

21

Class C example

Page 22: 1 TCP/IP introduction ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem, Ph.D. anan@cpe.ku.ac.th anan Computer Engineering Department Kasetsart

22

Network Address

Page 23: 1 TCP/IP introduction ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem, Ph.D. anan@cpe.ku.ac.th anan Computer Engineering Department Kasetsart

23

Sample internet

Network and Host addresses

Page 24: 1 TCP/IP introduction ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem, Ph.D. anan@cpe.ku.ac.th anan Computer Engineering Department Kasetsart

24

A Network with Two Levels of Hierarchy

Page 25: 1 TCP/IP introduction ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem, Ph.D. anan@cpe.ku.ac.th anan Computer Engineering Department Kasetsart

25

A Network with Three Levels of Hierarchy

Page 26: 1 TCP/IP introduction ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem, Ph.D. anan@cpe.ku.ac.th anan Computer Engineering Department Kasetsart

26

Addresses with and without Subnetting

Page 27: 1 TCP/IP introduction ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem, Ph.D. anan@cpe.ku.ac.th anan Computer Engineering Department Kasetsart

27

Masking

Page 28: 1 TCP/IP introduction ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem, Ph.D. anan@cpe.ku.ac.th anan Computer Engineering Department Kasetsart

28

Default Mask

Class

In BinaryIn Dotted-Decimal

Using Slash

A 11111111 00000000 00000000 00000000 255.0.0.0 /8

B 11111111 11111111 00000000 00000000 255.255.0.0 /16

C 11111111 111111111 11111111 00000000255.255.255

.0/24

Page 29: 1 TCP/IP introduction ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem, Ph.D. anan@cpe.ku.ac.th anan Computer Engineering Department Kasetsart

29

Subnet Design Given a network 194.30.12.0 with

16 hosts in each subnetwork Find the following:

The number of subnetworks Sub-network ID / Broadcast Address Sub-netmask First/Last address that can be used

for each subnet

Page 30: 1 TCP/IP introduction ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem, Ph.D. anan@cpe.ku.ac.th anan Computer Engineering Department Kasetsart

30

Subnet Design

Last Byte(Host ID)

192.30.12.0Class C IP address

16 Hosts 24 =16 is not enough (subnetID and broadcast) 25 = 32 total of 30 hosts 5 bits for Host and 3 bits for subnet

HostSubnet

Page 31: 1 TCP/IP introduction ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem, Ph.D. anan@cpe.ku.ac.th anan Computer Engineering Department Kasetsart

31

Subnet Design

255 255 255. . .1 1 1 0 0 0 0 0

Subnet Mask

00000000 = 000100000 = 3201000000 = 6401100000 = 9610000000 = 12810100000 = 16011000000 = 19211100000 = 224

Subnet Host

255 255 255. . . 224

Subnet ID 194 30 12. . .194 30 12. . .194 30 12. . .194 30 12. . .194 30 12. . .194 30 12. . .194 30 12. . .194 30 12. . .

Page 32: 1 TCP/IP introduction ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem, Ph.D. anan@cpe.ku.ac.th anan Computer Engineering Department Kasetsart

32

Subnet DesignSubne

tSubnet ID 1st Add Last Add Broadcast

0 192.30.12.0 192.30.12.1 192.30.12.30

192.30.12.31

1 192.30.12.32

192.30.12.33

192.30.12.62

192.30.12.63

2 192.30.12.64

192.30.12.65

192.30.12.94

192.30.12.95

3 192.30.12.96

192.30.12.97

192.30.12.126

192.30.12.127

4 192.30.12.128

192.30.12.129

192.30.12.158

192.30.12.159

5 192.30.12.160

192.30.12.161

192.30.12.190

192.30.12.191

6 192.30.12.192

192.30.12.193

192.30.12.222

192.30.12.223

7 192.30.12.224

192.30.12.225

192.30.12.254

192.30.12.255