sparcs wheel seminar #3 한재웅. 10/3/2005sparcs wheel seminar2 overview tcp/ip networking...
TRANSCRIPT
SPARCS Wheel Seminar #3
한재웅 <[email protected]>
10/3/2005 SPARCS Wheel Seminar 2
Overview
• TCP/IP Networking– Overview of TCP/IP– TCP/IP network model– IP Addresses– NAT– IPv6– ARP: The Address Resolution Protocol– DHCP– Addition of Machines to a Network– Debian Network Configuration
• Routing – Packet Forwarding
• Network Hardware– Ethernet : The common LAN
10/3/2005 SPARCS Wheel Seminar 3
TCP/IP Networking – Overview of TCP/IP
• TCP/IP (Transmission Control Protocol/ Internet protocol)– A set of network protocols designed to work smoothly
together.– TCP : 상위계층 . 메시지 파일을 좀 더 작은 패킷으로
나누어 인터넷을 통해 전송 . 수신된 패킷들을 원래의 메시지로 재조립 .
– IP : 하위계층 . 각 패킷의 주소부분을 처리 . 패킷들이 목적지에 정확하게 도달할 수 있게 함 .
10/3/2005 SPARCS Wheel Seminar 4
TCP/IP Network Model(1/2)
Layer FunctionApplication layer End-user application programs
Transport layer Delivery of Data to applications
Network layer Basic communication, addressing, and routing
Link layer Network hardware and device drivers
Physical layer The cable or physical medium itself
10/3/2005 SPARCS Wheel Seminar 5
TCP/IP Network Model(2/2) – TCP/IP Family
Application layer
Transport layer
Network layer
Link layer
Physical layer
10/3/2005 SPARCS Wheel Seminar 6
IP Addresses (1/2)
• IP Address
– Internet address.– Four bytes long.– Divided into a network part and a host part.
• Network part : Identifies a logical network to which the address refers.
• Host part : identifies a machine on that network.
10/3/2005 SPARCS Wheel Seminar 7
IP Addresses (2/2)
• Example
• When 127 is the first byte of an address..– Loopback network.– Fictitious network that has no real hardware interface and only one host.– The loopback address 127.0.0.1…
• Always refers to the current host.• Its symbolic name is “localhost”.
• Ifconfig– An interface’s IP address and other parameter are set with.
128.138.240.1
Part of the network portion
10/3/2005 SPARCS Wheel Seminar 8
IP addresses classes
• IP addresses were grouped into “classes” depending on the first bits of the leftmost byte.
• The class determined which bytes of the address were in the network portion and which were in the host portion.
• Historical Internet address classes
Class 1st byte Format Comments
A 1-126 N.H.H.H Very early networks, or reserved for DOD
B 128-191 N.N.H.H Large sites, usually subnetted, were hard to get
C 192-223 N.N.N.H Easy to get, often obtained in sets
D 224-239 - Multicast addresses, not permanently assigned
E 240-254 - Experimental addresses
10/3/2005 SPARCS Wheel Seminar 9
Subnetting and netmasks(1/2)
• Subnet– Subnetwork 를 줄인 말 .– 어떤 기관에 소속된 network 지만 따로 분리되어 있는 한 부분으로
인식될 수 있는 network 을 말한다 .– 여러 개의 subnet 으로 나누어진 어떤 조직의 network 은 internet 에
하나의 공유된 network 주소로 접속할 수 있다 .– Subnet 이 없으면 물리적으로 분산된 subnetwork 마다 하나씩
여러군데의 인터넷접속을 가지게 되고 , 그럼으로써 한정된 량의 인터넷 주소가 쓸모없이 낭비되게 된다 .
• Subnet 추가의 example
143.248.234.125
Network번호
Host번호
143.248.234.125
Network 번호
Subnet 주소
Host번호
10/3/2005 SPARCS Wheel Seminar 10
Subnetting and netmasks(2/2)
• Subnet mask– IP Address 의 32bit 중 첫번째 bit 에서 몇번째 bit 까지를 Netwo
rk Address 로 할 것인지를 알려주는 역할을 하는 것 .– IP Address 와 마찬가지로 32bit 로 구성 .– Each bit of the netmask that corresponds to the network portion
of an IP address is set to 1, and host bits are set to 0.– Ifconfig normally uses the inherent class of an address to figure
out which bits are part of the network.
10/3/2005 SPARCS Wheel Seminar 11
NAT (Network Address Translation)
• NAT– 외부 Network 에 알려진 것과 다른 IP 주소를 사용하는 내부
Network 에서 , IP 주소를 변환하는 것 . – To allow hosts that use these private addresses to talk
to the Internet, the site’s border router runs a system called NAT
– 나가거나 들어오는 각 요구들이 주소 변환과정을 반드시 거쳐야 하기 대문에 보안문제를 확실하게 하는데 도움 .
• 요구를 제한하거나 인증하고 , 또 이전의 요구와 일치시키는 기회를 제공 .
10/3/2005 SPARCS Wheel Seminar 12
IPv6(Internet Protocol Version 6) Addressing(1/3)
• IPv6– 최신의 IP.– 주요 컴퓨터 운영체계를 비롯한 많은 제품에서 IP 지원의 일부로서 포함 .
• IPv6 의 특성– IP 주소의 길이가 32Bit 에서 128Bit 으로 늘어남 .
• 가까운 장래에 인터넷이 폭발적으로 성장함으로써 , network address 가 금새 부족해 질것이라는 우려에 대한 대응책을 제시 .
– IP 헤더 포맷의 단순화• IP 패킷의 처리를 신속하게 할 수 있도록 고정크기의 단순한 헤더구조 정의
– IP 헤더 및 옵션의 확장성• 확장헤더를 통해 네트워크 기능에 대한 확장 및 옵션기능의 확장이 용이한
구조로 정의– Flow Labeling
• Flow label 개념을 도입 , 특정 트래픽은 별도의 특별한 처리 ( 실시간 통신 등 ) 를 할 수 있도록 함 .
– 인증 및 보안기능 • 인증 , 데이터 보호 , 데이터 보안을 IP 프로토콜 체계에 반영 , IPv6
확장헤더를 통해 적용 가능 .
10/3/2005 SPARCS Wheel Seminar 13
IPv6(Internet Protocol Version 6) Addressing(2/3)
Bits Acronym translation
1-3 FP Format prefix; the type of address, e.g., unicast
4-16 TLA ID Top-level aggregation ID, like backbone ISP
17-24 RES Reserved for future use
25-48 NLA ID Next-level aggregation ID, e.g., regional ISPs and site ID
49-64 SLA ID Site-level aggregation ID, like local subnet
65-128 INTERFACE ID Interface identifier (MAC address plus padding)
ISP prefix Subnet Host identifier
45 bits 16 bits 64 bits
Address type 3 bits
10/3/2005 SPARCS Wheel Seminar 14
IPv6(Internet Protocol Version 6) Addressing(3/3)
• A strong/weak point of IPv6– The brand and model of interface card are encoded in the first ha
lf of the MAC address, so hackers with code for a particular architecture will be helped along.
– The IPv6 folks have responded by pointing out that sites are not actually required to use MAC addresses; they’re free to use whatever they want for the host address.
– Assigning IPv6 addresses should be easier than assigning IPv4 address.
– The hosts can configure themselves.– The format prefix identifies the type of IPv6 address : unicast, mu
lticast, or anycast.
10/3/2005 SPARCS Wheel Seminar 15
ARP (The Address Resolution Protocol)
• ARP– IP Network 상에서 IP Address 를 physical network address 로
대응시키기 위해 사용되는 protocol.– IP Host A 가 IP Host B 에게 IP Packet 을 전송하고자 할때 IP Ho
st B 의 Physical Network Address 를 모르는 경우 , ARP Protocol을 사용하여 목적지 IP Address B 와 Broadcasting Physical Network address FFFFFFFFFFFF 를 가지는 ARP Packet 을 Network상에 전송 . IP Host B 는 자신의 IP Address 가 목적지에 있는 ARP Packet 를 수신하면 자신의 Physical Network Address 를 A에게 응답 .
– ARP uses broadcast packets, which cannot cross networks, it can only be used to find the hardware addresses of machines connected directly to the sending host’s local network.
10/3/2005 SPARCS Wheel Seminar 16
DHCP (the Dynamic Host Configuration Protocol) (1/2)
• DHCP
– Network 관리자들이 조직 내의 Network 상에서 IP Address 를 중앙에서 관리하고 할당해줄 수 있도록 해주는 프로토콜 .
– Network 관리자가 중앙에서 IP 주소를 관리하고 할당하며 , 컴퓨터가 Network 의 다른 장소에 접속되었을 대 자동으로 새로운 IP Address 를 보내줄 수 있게 해준다 .
– 일정한 시간동안만 그 컴퓨터에 유효하도록 하는 “임대 (lease)”개념을 사용 .
– 사용 가능한 IP 주소의 개수보다 더 많은 컴퓨터가 있는 경우에 IP 주소의 임대시간을 짧게 함으로써 Network 를 동적으로 재구성할 수 있음 .
10/3/2005 SPARCS Wheel Seminar 17
DHCP (the Dynamic Host Configuration Protocol) (2/2)
• DHCP’s leasable parameters
– IP addresses and netmasks– Gateways (default routes)– DNS name servers– Syslog hosts– WINS servers, X font servers, proxy servers, NTP severs– TFTP servers (for loading a boot image)
10/3/2005 SPARCS Wheel Seminar 18
Addition of Machines to a Network (1/6)
• The basic steps.
– Assign an IP address and hostname– Set up the new host to configure its network interfaces
at boot time– Set up a default route and perhaps fancier routing– Point to a DNS name server, to allow access to the rest
of the Internet
10/3/2005 SPARCS Wheel Seminar 19
Addition of Machines to a Network (2/6)
• /etc/hosts
– The oldest and simplest way to map names to IP addresses.
– Contains only local mappings, most modern systems use it only for mapping that are need at boot time
– Important during the boot process because DNS is not yet available
10/3/2005 SPARCS Wheel Seminar 20
Addition of Machines to a Network (3/6)
• Ifconfig : configure network interfaces.
– Enables or disables a network interface.– Set its IP address and subnet mask.– Set various other options and parameters.– Displays the current settings for interface without changing them.
Ifconfig interface address options … up
Ifconfig en0 128.138.240.1 netmask 255.255.255.0 up
10/3/2005 SPARCS Wheel Seminar 21
Addition of Machines to a Network (4/6)
• Route : configure static routes.
– Defines static routes.– 한 컴퓨터로부터 다른 컴퓨터를 어떤 방법으로 찾아가는가를 적절하게
설명하기 위한 구조– Destination 와 gateway 의 한 쌍의 주소로 정의 .– Performed in IP layer– Each route command adds or removes one route
Route [-f] op [type] destination gateway [hop-count]
Add to add a route and delete to remove one
10/3/2005 SPARCS Wheel Seminar 22
Addition of Machines to a Network (5/6)
• Default routes
– To set a default route, simply add the following line to your startup files:
– 대부분은 Startup file 에 직접 IP Address 를 넣는 것보다 , configuration file 에서 gateway IP Address 를 얻어온다 .
Route add default gateway-IP-address
10/3/2005 SPARCS Wheel Seminar 23
Addition of Machines to a Network (6/6)
• Configuring DNS
– /etc/resolv.conf• Lists the DNS domains that should be searched to resolve na
mes that are incomplete and the IP addresses of the name servers to contact for name lookups.
• List the “closest” stable name server first because the server in the first position will be contacted first.
10/3/2005 SPARCS Wheel Seminar 24
Network Configuration for Debian
• /etc/network/interfaces is where the configuration
of your network is stored.
• ….-_-;;;
10/3/2005 SPARCS Wheel Seminar 25
Routing (1/2)
• Router
– 동일한 전송 프로토콜을 사용하는 분리된 network 를 연결하는 장치로 network 계층간을 서로 연결 .
– 브리지가 가지는 기능에 추가하여 경로 배정표에 따라 다른 network또는 자신의 network 내의 node 를 결정 .
– 가장 효율적인 경로를 선택하여 패킷전송– 흐름을 제어 . – Network 내부에서 여러 subnetwork 을 구성 , 다양한
network 관리기능 수행
10/3/2005 SPARCS Wheel Seminar 26
Routing (2/2)
• Packet Forwarding – Example Network
Host A145.17
145.24Router
R1
199.165.145
network
146.1
199.165.146network
146.4
Host B
RouterR2
146.3
To the internet
216.12.111.80
10/3/2005 SPARCS Wheel Seminar 27
Ethernet (1/6)
• 2 개 이상의 station 들이 공통된 cabling system 을 공유 할 수 있도록 하는 CSMS/CD 방식에 기초한 IEEE 802.3 series standard
• 가장 광범위하게 설치된 근거리통신망 기술• IEEE 802.3 에 표준으로 정의 .• 이더넷은 원래 제록스에 의해 개발되었으며 , 제록스와 DED
그리고 인텔 등에 의해 발전 . • 이더넷 랜은 일반적으로 동축케이블 또는 특별한 등급이 매겨진 비차폐 연선 (UTP) 을 사용
• CSMA/CD– Ethernet 의 전송 프로토콜 .
10/3/2005 SPARCS Wheel Seminar 28
Ethernet (2/6)• The evolution of Ethernet
Year Speed Commom name IEEE# Dist Media
1973 3Mb/s Xerox Ethernet - ? Coax
1980 10Mb/s Ethernet 1 - 500m RG-11 coax
1982 10Mb/s DIX Ethernet(Ethernet II) 802.3 500m RG-11 coax
1985 10Mb/s 10Base5(“Thicknet”) 802.3 500m RG-11 coax
1985 10Mb/s 10Base2(“Thinnet”) 802.3 180m RG-58 coax
1989 10Mb/s 10BaseT 802.3 100m Category 3 UTP copper
1993 10Mb/s 10BaseF 802.3 2km25km
MM FiberSM Fiber
1994 10Mb/s 100BaseTX(“100 meg”) 802.3u 100m Category 5 UTP copper
1994 100Mb/s 1000BaseFX 802.3u 2km20km
MM FiberSM Fiber
1998 100Mb/s 1000BaseSX 802.3z 260m550m
62.5- ㎛ MM Fiber50- ㎛ MM fiber
1998 1Gb/s 1000BaseLX 802.3z 440m550m3km
62.5- ㎛ MM Fiber50- ㎛ MM fiber
SM fiber
1998 1Gb/s 1000BaseCX 802.3z 25m Twinax
1999 1Gb/s 1000BaseT(“Gigabit”) 802.3ab 100m Cat 5E and 6 UTP copper
10/3/2005 SPARCS Wheel Seminar 29
Ethernet (3/6)
• How ethernet works
– Carrier Sense • You can tell whether anyone is talking
– Multiple access• Everyone can talks
– Collision Detection• You know when you interrupt someone else
10/3/2005 SPARCS Wheel Seminar 30
Ethernet (4/6)
• Ethernet topology– Branching bus with no loops
• Only one way for a packet to travel between any two hosts on the same network.
– Provides a mechanism to exchange three types of packets on a segment
• Unicast : addressed to only one host• Multicast : addressed to a group of hosts• Broadcast : delivered to all hosts on a segment
10/3/2005 SPARCS Wheel Seminar 31
Ethernet (5/6)
• UTP– Unshielded twisted pair.– The preferred cable medium for Ethernet.– Based on star topology.– Has several adventages over other media
• Inexpensive. Readily available copper wire• Easier to install and debug than coax or fiber.• Uses RJ-45 connectors, which are cheap, reliable, and easy to instal
l• Each machine is independent
10/3/2005 SPARCS Wheel Seminar 32
Ethernet (6/6)
• Connecting and expanding Ethernets– Logically connected at several points in the seven-layer ISO
network model• Layer 1 : the physical layer.• Layer 2 : the data link layer.• Layer 3 : the network layer.
– Hubs• Active devices that connect physical segments in UTP
Ethernet networks.– Switches
• Connect Ethernets at the data link layer of the ISO model.– Routers
• They are dedicated computers-in-a-box that contain two or more network interfaces and direct traffic at layer 3 (the network layer) of the ISO protocol stack