• 沒有找到結果。

TCP/IP for Linux

N/A
N/A
Protected

Academic year: 2022

Share "TCP/IP for Linux"

Copied!
6
0
0

加載中.... (立即查看全文)

全文

(1)

67

TCP/IP for Linux

郭大維教授

ktw@csie.ntu.edu.tw

國立台灣大學 資訊工程系

68

Internet

?Origin:

?ARPANET (1970’s - 1988)

?NSF NET (no longer exist?) and Internet.

?World Wide Web (WWW)

?Utilize TCP/IP over ARPANET/Internet.

?Linux adopts Unix 4.3BSD sockets and supports TCP/IP.

•Definition of “Intranet”: roughly speaking for any network under one authorization, e.g., a company or a school.

Often in a Local Area Network (LAN), or connected LAN’s.

• Having one (or several) gateway with the outside world.

• In general, it has a higher bandwidth because of a LAN.

(2)

69

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2001.

TCP/IP

? IP Address:

?140.123.101.1

?256*256*256*256 combinations

?140.123 -> Network Address

?101.1 -> Host Address

?Subnet:

?140.123.101 and 140.123.102

?Mapping of IP addresses and host names

?Static assignments: /etc/hosts

?Dynamic acquisition: DNS (Domain Name Server)

?/etc/resolv.confg

?If /etc/hosts is out-of-date, re-check it up with DNS!

?Domain name: cs.ccu.edu.tw as a domain name for 140.123.100, 140.123. 101, and 140.123.103

Name Resolution in TCP/IP Network

?Name Resolution

?A hierarchical host name

?bob.csie.ntu.edu.tw

?A 32-bit Internet Number (host id)

?140.112.101.32

?How it works?

?The sending system checks its routing table to locate a router. The routers use the network part of the host-id to transfer the packet to the destination network.

(3)

71

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2001.

Name Resolution in TCP/IP Network

? Mapping of Ethernet (IEEE 802.3) physical addresses and IP addresses

?Each Ethernet card has a built-in Ethernet physical address, e.g., 08-01-2b-00-50-A6.

?Ethernet cards only recognize frames with their physical addresses.

?Linux uses ARP (Address Resolution Protocol) to know and maintain the mapping.

?Periodically broadcast requests over Ethernet for IP address resolution over ARP.

?A UDP packet with the host-id and Ethernet address

?Machines with the indicated IP addresses reply with their Ethernet physical addresses.

72

Name Resolution in TCP/IP Network

?Within a network,

?Each host caches the info in its ARP cache with aging.

?When a process specifies a host to communicate.

?The kernel determine the host’s in using domain name server (DNS) lookup.

?Pass all layers with Ethernet address in the packet.

?The Host receives the packets and pass all layers.

(4)

73

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2001.

TCP/IP

TCP header + Data

IP header Data

Ethernet header Data

An Ethernet frame

An IP packet

A TCP packet

• Each IP packet has an indicator of which protocol used, e.g., TCP or UDP

Routing

?Def:

?How are msgs sent through network?

?Common routing scheme

?Fixed routing

?A path is specified in advance & does not change!

?Virtual routing

?A path is fixed for a session, e.g., a file transfer or remote login!

?Dynamic routing

?A path is chosen only when a msg is sent.

?Wrong sequence order!

(5)

75

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2001.

TCP/IP

?Router

?With a Routing table

?Use some routing protocol, e.g., to maintain network topology by broadcasting.

?Connecting several subnets (of the same IP- or-higher-layer protocols) for forwarding packets to proper subnets.

?Gateway

?Functionality containing that of routers.

?Connecting several subnets (of different or the same networks, e.g., Bitnet and Internet)for forwarding packets to proper subnets.

76

TCP/IP

gateway

gateway TARNET

HINET

Intranet AIntranet

AIntranet

Intranet

router Intranet

(6)

77

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2001.

Network Layers in Linux

PPP SLIP Ethernet

Internet Protocol (IP)

Transport Layer ARP

TCP UDP

INET sockets

BSD sockets Kernel

Applications applications

TCP/IP

?Transmission Control Protocol (TCP)

?Reliable point-to-point packet transmissions.

?Applications which communicate over TCP/IP with each another must provide IP addresses and port numbers.

?/etc/services

?Port# 80 for a web server.

?User Datagram Protocol (UDP)

?Unreliable point-to-point services.

?Both are over IP.

參考文獻

相關文件

„ Transport voice traffic using the Internet Protocol (IP). „ One of the greatest challenges to VoIP is voice

z The caller sent signaling information over TCP to an online Skype node which forwarded it to callee over TCP. z The online node also routed voice packets from caller to callee

The format string is like a constraint except that there could be place-holder strings like “%s” and “%d” for strings and integers respectively.. The format string F is like

Allen Bradley Ethernet IP(Controllogix, Compactlogix)

(A) IP (Internet Protocol) (B) ICMP (Internet Control Message Protocol) (C) ARP (Address Resolution Protocol) (D)SNMP (Simple Network Management Protocol)

™ 其功能是列出系統的 ARP Table,以及設定及 刪除 ARP

™ 經由 PPP 取得網路IP、Gateway與DNS 等 設定後,並更動 Routing Table,將Default Gateway 設為由 PPP取得的 Gateway

IP Layer Basics and Firewall & Networking tools (ifconfig, route, ip, iptables, nslookup, dig, arp) (作業:pfSense firewall)d. Unix basic concept, Unix basic