becool

20210517 (월) 본문

네트워크 기초

20210517 (월)

gusalstm 2021. 5. 17. 16:24
반응형

9:33 review 

프로토콜 요약

 

TCP

 연결지향, 신뢰성있는 바이트스트림

 신뢰성있는 데이터 전송 : 메시지를 성공적으로 수신 했거나 오류가 발생했다는 것을 알리는 것.

 신뢰성있고 순서적인 데이터 전송 : Connection Oritented Service 송신측 전송 계층 프로세스와 목적지 전송 계층 프로세스 사이에 연결이라는 논리적 관계가 설정된다는 것

 

※ TCP 3-way handshake : SYN, SYN-ACK, ACK

   TCP를 통한 데이터 전송 전 TCP 세션 연결을 수립하는 과정

   체결 established

 

※ TCP 4-way handshake : FIN ACK, ACK, FIN ACK, ACK   (Active close - Passive close)

   TCP 세션 연결을 정상 종료하는 과정

 

 

TCP 헤더의 구조

 

Source Port

Destination Port

Sequence Number

Acknowledgement Number

Offset

Reserved

TCP control flags

 CWR(Reduced) : Congestion Windows

 ECE : ECN echo, Congestion Windows

 urg : Urgent data 가 있는경우 1, 없는경우 0

 ack : Acknowledgement number 수신 데이터에 대한 응답을 보낼 때 사용하는 플래그

 psh : Push 데이터 전송 시 사용하는 플래그

 rst : Reset 연결을 강제종료 하거나 리셋시 사용하는 플래그

 syn : synchronize TCP 연결 동기화를 위해 사용하는 플래그

 fin : TCP 연결을 정상적으로 종료하기 위해 사용하는 플래그

Windows size : 16bit 길이로 수신버퍼의 크기

Checksum : 16bit TCP 세그먼트의 전체 데이터 (TCP 헤더 + 데이터) 오류 체크하기 위한 필드

Urgent Pointer ; 16bit 길이로 Urgent Data가 존재하는 경우 Urgent Data의 끝 부분을 가리키는 Pointer

Options : 가변길이 4bytes 단위

 

 

UDP 

 비연결 지향 프로토콜 (Connectionless Oriented Protocol)

 헤더의 크기 : 8bytes

 독립적인 제어메시지 사용하지 않음

 요청메시지/응답메시지 두가지로 구성

 DNS, DHCP, SNMP 등

 

================================

 

Packet Tracer

Cisco Systems 사에서 개발한 네트워크 시뮬레이터

www.netacd.com 에서 회원가입, Packet Tracer 7.3.1 

 

스위치 : catalyst 2950 3750 L2 데이터링크부터 L3까지 커버가능한 다양한 모델이 있음.

      기본스위치 : L2에서 동작하는 스위치위주로 실습 (2950 : fast ethernet , 2960)  

      2950-24 : 포트 24개까지 지원

      2950-24T : 포트 24개까지 지원 + giga bit 2개의 포트 추가 지원

      2960 : giga bit 기본 지원

      3750 : L3까지 지원하면서 광슬롯

 

Connection 전송매체 종류

  Straight-Through Cable (=Direct) : 

  Crossover Cable : 같은 장비들끼리 연결  (pc-pc, switch-switch, hub-hub 등)

  Rollover Cable : 제어하고자 할때 네트워크 장비-PC 간 연결 → Terminal Configuration

     ※ 네트워크 장비에는 별도의 입력장치가 없으므로 PC와 연결(console)을 통하여 세팅

     ※ RS232 (해당 규격이 사라지는 추세, USB나 USB로 컨버터로 PC와 연결) + 네트워크 장비 콘솔

  Serial DCE 

  Serial DTE  

 

DCE (Data Communication Equipment)

 Serial 통신에서 Clock을 생성해주는 장비

 CSU/DSU/Modem

DTE (Data Terminal Equipment)  

 Serial 구간에서 관리하는 네트워크와 연결된 마지막 장비

▶ 패킷 트레이서에서 serial DTE, serial DCE는 먼저 클릭한 쪽과 이끌어서 연결한 쪽 두가지로 나누게됨.

 

Cisco Systems IOS : Internetwork OS

 Cisco 네트워크 장비의 운영체제

 

Cisco IOS 모드

 각각의 모드에서 사용가능한 명령어, 설정 등이 정해져있으므로 각각의 모드에 대한 이해가 필요.

 - User Mode : 가장 처음 진입하는 모드. 제한적인 모드 (다른장비와의 통신 테스트 정도만 가능)

 - Privileged mode : 특권, 관리자모드. enable로 접근가능 다른 네트워크장비의 설정 확인, 저장 등이 가능

 - Global Configuration mode : 네트워크 장비의 전역적 설정을 할 수 있는 모드 (Hostname, Interface 등)

 - Interface Mode : Ethernet, FastEthernet, Serial 등 인터페이스를 설정하는 모드

 - Line Interface Mode : Console, VTY 등 Line Interface를 설정하는 모드

  

 

 

=== IOS의 명령어  === 

 

<유저실행모드>

Router>?
Exec commands:
  <1-99>      Session number to resume
  connect     Open a terminal connection
  disable     Turn off privileged commands
  disconnect  Disconnect an existing network connection
  enable      Turn on privileged commands
  exit        Exit from the EXEC
  logout      Exit from the EXEC
  ping        Send echo messages
  resume      Resume an active network connection
  show        Show running system information
  ssh         Open a secure shell client connection
  telnet      Open a telnet connection
  terminal    Set terminal line parameters
  traceroute  Trace route to destination

 

<프리빌리지모드>

Router#?
Exec commands:
  <1-99>      Session number to resume
  auto        Exec level Automation
  clear       Reset functions
  clock       Manage the system clock
  configure   Enter configuration mode
  connect     Open a terminal connection
  copy        Copy from one file to another
  debug       Debugging functions (see also 'undebug')
  delete      Delete a file
  dir         List files on a filesystem
  disable     Turn off privileged commands
  disconnect  Disconnect an existing network connection
  enable      Turn on privileged commands
  erase       Erase a filesystem
  exit        Exit from the EXEC
  logout      Exit from the EXEC
  mkdir       Create new directory
  more        Display the contents of a file
  no          Disable debugging informations
  ping        Send echo messages
  reload      Halt and perform a cold restart
  resume      Resume an active network connection
  rmdir       Remove existing directory
  send        Send a message to other tty lines
  setup       Run the SETUP command facility
  show        Show running system information
  ssh         Open a secure shell client connection
  telnet      Open a telnet connection
  terminal    Set terminal line parameters
  traceroute  Trace route to destination
  undebug     Disable debugging functions (see also 'debug')
  vlan        Configure VLAN parameters
  write       Write running configuration to memory, network, or terminal

 

<글로벌컨피그레이션 모드>

Router(config)#?
Configure commands:
  aaa                Authentication, Authorization and Accounting.
  access-list        Add an access list entry
  banner             Define a login banner
  bba-group          Configure BBA Group
  boot               Modify system boot parameters
  cdp                Global CDP configuration subcommands
  class-map          Configure Class Map
  clock              Configure time-of-day clock
  config-register    Define the configuration register
  crypto             Encryption module
  default            Set a command to its defaults
  do                 To run exec commands in config mode
  dot11              IEEE 802.11 config commands
  enable             Modify enable password parameters
  end                Exit from configure mode
  exit               Exit from configure mode
  flow               Global Flow configuration subcommands
  hostname           Set system's network name
  interface          Select an interface to configure
  ip                 Global IP configuration subcommands
  ipv6               Global IPv6 configuration commands
  key                Key management
  license            Configure license features
  line               Configure a terminal line
  lldp               Global LLDP configuration subcommands
  logging            Modify message logging facilities
  login              Enable secure login checking
  mac-address-table  Configure the MAC address table
  no                 Negate a command or set its defaults
  ntp                Configure NTP
  parser             Configure parser
  policy-map         Configure QoS Policy Map
  port-channel       EtherChannel configuration
  priority-list      Build a priority list
  privilege          Command privilege parameters
  queue-list         Build a custom queue list
  radius-server      Modify Radius query parameters
  router             Enable a routing process
  secure             Secure image and configuration archival commands
  security           Infra Security CLIs
  service            Modify use of network based services
  snmp-server        Modify SNMP engine parameters
  spanning-tree      Spanning Tree Subsystem
  tacacs-server      Modify TACACS query parameters
  username           Establish User Name Authentication
  vpdn               Virtual Private Dialup Network
  vpdn-group         VPDN group configuration

 

Router(config)#line ?
  <2-499>  First Line number
  aux      Auxiliary line
  console  Primary terminal line  콘솔
  tty      Terminal controller
  vty      Virtual terminal  원격
  x/y/z    Slot/Subslot/Port for Modems

Router(config)#line console 0

 

<인터페이스모드>

Router(config)#interface ?
  Dialer            Dialer interface
  Dot11Radio        Dot11 interface
  Ethernet          IEEE 802.3
  FastEthernet      FastEthernet IEEE 802.3
  GigabitEthernet   GigabitEthernet IEEE 802.3z
  Loopback          Loopback interface
  Port-channel      Ethernet Channel of interfaces
  Serial            Serial
  Tunnel            Tunnel interface
  Virtual-Template  Virtual Template interface
  Vlan              Catalyst Vlans
  range             interface range command

 

=== IOS의 명령어 실습  ===

    

Router>enable → Privileged 모드로 전환

Router#show interfaces

Router#show running-config 

Router#configure terminal   → 글로벌 컨피그레이션 모드로 전환
Enter configuration commands, one per line.  End with CNTL/Z.

Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname R1  → hostname [NAME] 라우터의 장비 이름을 영구적으로 변경(런타임이 아닌)
R1(config)#interface gigabitEthernet 0/0  → interface + Device : 인터페이스 모드로 전환
R1(config-if)#exit

R1(config)#line console 0 → 라인콘솔 모드

R1(config-line)# exit → 글로벌 컨피그레이션 모드로 전환

R1(config)#exit → priviledged 모드로 전환
R1# 
%SYS-5-CONFIG_I: Configured from console by console
disable  → user mode로 전환
R1>

 

※ priviledged mode에서 오타입력. 호스트로 인식하여 접속을 시도 :  접속 시도를 중지할려면 Ctrl + Shift + 6 입력

 

2811 router 장비 슬롯 번호
WIC-2T, NM-2FE2W 두 가지 장착

serial 0/0/0, serial 0/0/1 형태로 추가됨

장비에 전원을 넣고 CLI 탭으로 이동

 

Router>enable
Router#show interfaces

FastEthernet0/0 is administratively down, line protocol is down (disabled)
  Hardware is Lance, address is 00d0.d36d.5401 (bia 00d0.d36d.5401)
  MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Full-duplex, 100Mb/s, media type is RJ45
  ARP type: ARPA, ARP Timeout 04:00:00, 
  Last input 00:00:08, output 00:00:05, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0 (size/max/drops); Total output drops: 0
  Queueing strategy: fifo
  Output queue :0/40 (size/max)
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     0 packets input, 0 bytes, 0 no buffer
     Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     0 input packets with dribble condition detected
     0 packets output, 0 bytes, 0 underruns
     0 output errors, 0 collisions, 1 interface resets
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier

Router#show interfaces
FastEthernet0/0 is administratively down, line protocol is down (disabled)
  Hardware is Lance, address is 00d0.d36d.5401 (bia 00d0.d36d.5401)
  MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Full-duplex, 100Mb/s, media type is RJ45
  ARP type: ARPA, ARP Timeout 04:00:00, 
  Last input 00:00:08, output 00:00:05, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0 (size/max/drops); Total output drops: 0
  Queueing strategy: fifo
  Output queue :0/40 (size/max)
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     0 packets input, 0 bytes, 0 no buffer
     Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     0 input packets with dribble condition detected
     0 packets output, 0 bytes, 0 underruns
     0 output errors, 0 collisions, 1 interface resets
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier
     0 output buffer failures, 0 output buffers swapped out
FastEthernet0/1 is administratively down, line protocol is down (disabled)
  Hardware is Lance, address is 00d0.d36d.5402 (bia 00d0.d36d.5402)
  MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Full-duplex, 100Mb/s, media type is RJ45
  ARP type: ARPA, ARP Timeout 04:00:00, 
  Last input 00:00:08, output 00:00:05, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0 (size/max/drops); Total output drops: 0
  Queueing strategy: fifo
  Output queue :0/40 (size/max)
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     0 packets input, 0 bytes, 0 no buffer
     Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     0 input packets with dribble condition detected
     0 packets output, 0 bytes, 0 underruns
     0 output errors, 0 collisions, 1 interface resets
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier
     0 output buffer failures, 0 output buffers swapped out
Serial0/0/0 is administratively down, line protocol is down (disabled)
  Hardware is HD64570
  MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation HDLC, loopback not set, keepalive set (10 sec)
  Last input never, output never, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0 (size/max/drops); Total output drops: 0
  Queueing strategy: weighted fair
  Output queue: 0/1000/64/0 (size/max total/threshold/drops)
     Conversations  0/0/256 (active/max active/max total)
     Reserved Conversations 0/0 (allocated/max allocated)
     Available Bandwidth 1158 kilobits/sec
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     0 packets input, 0 bytes, 0 no buffer
     Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     0 packets output, 0 bytes, 0 underruns
     0 output errors, 0 collisions, 1 interface resets
     0 output buffer failures, 0 output buffers swapped out
     0 carrier transitions
     DCD=down  DSR=down  DTR=down  RTS=down  CTS=down
Serial0/0/1 is administratively down, line protocol is down (disabled)
  Hardware is HD64570
  MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation HDLC, loopback not set, keepalive set (10 sec)
  Last input never, output never, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0 (size/max/drops); Total output drops: 0
  Queueing strategy: weighted fair
  Output queue: 0/1000/64/0 (size/max total/threshold/drops)
     Conversations  0/0/256 (active/max active/max total)
     Reserved Conversations 0/0 (allocated/max allocated)
     Available Bandwidth 1158 kilobits/sec
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     0 packets input, 0 bytes, 0 no buffer
     Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     0 packets output, 0 bytes, 0 underruns
     0 output errors, 0 collisions, 1 interface resets
     0 output buffer failures, 0 output buffers swapped out
     0 carrier transitions
     DCD=down  DSR=down  DTR=down  RTS=down  CTS=down
FastEthernet1/0 is administratively down, line protocol is down (disabled)
  Hardware is Lance, address is 000a.41d9.b501 (bia 000a.41d9.b501)
  MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Full-duplex, 100Mb/s, media type is RJ45
  ARP type: ARPA, ARP Timeout 04:00:00, 
  Last input 00:00:08, output 00:00:05, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0 (size/max/drops); Total output drops: 0
  Queueing strategy: fifo
  Output queue :0/40 (size/max)
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     0 packets input, 0 bytes, 0 no buffer
     Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     0 input packets with dribble condition detected
     0 packets output, 0 bytes, 0 underruns
     0 output errors, 0 collisions, 1 interface resets
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier
     0 output buffer failures, 0 output buffers swapped out
FastEthernet1/1 is administratively down, line protocol is down (disabled)
  Hardware is Lance, address is 000a.41d9.b502 (bia 000a.41d9.b502)
  MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Full-duplex, 100Mb/s, media type is RJ45
  ARP type: ARPA, ARP Timeout 04:00:00, 
  Last input 00:00:08, output 00:00:05, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0 (size/max/drops); Total output drops: 0
  Queueing strategy: fifo
  Output queue :0/40 (size/max)
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     0 packets input, 0 bytes, 0 no buffer
     Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     0 input packets with dribble condition detected
     0 packets output, 0 bytes, 0 underruns
     0 output errors, 0 collisions, 1 interface resets
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier
     0 output buffer failures, 0 output buffers swapped out
Vlan1 is administratively down, line protocol is down
  Hardware is CPU Interface, address is 0001.4337.c736 (bia 0001.4337.c736)
  MTU 1500 bytes, BW 100000 Kbit, DLY 1000000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  ARP type: ARPA, ARP Timeout 04:00:00
  Last input 21:40:21, output never, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: fifo
  Output queue: 0/40 (size/max)
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     1682 packets input, 530955 bytes, 0 no buffer
     Received 0 broadcasts (0 IP multicast)
     0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
     563859 packets output, 0 bytes, 0 underruns
     0 output errors, 23 interface resets
     0 output buffer failures, 0 output buffers swapped out

 

Router(config)#interface fastEthernet 0/0
Router(config-if)#exit

Router(config)#interface FastEthernet 0/1
Router(config-if)#exit
Router(config)#interface FastEthernet 1/0
Router(config-if)#exit
Router(config)#interface FastEthernet 1/1
Router(config-if)#exit
Router(config)#interface Serial 0/0/0
Router(config-if)#exit
Router(config)#interface Serial 0/0/1
Router(config-if)#exit

 

 

PC마다 IP 부여하기 : desktop →  ip configuration → static → ipv4 address, subnet mask, default gateway, dns 입력 후 저장

 

각 PC마다 서로 통신되는지 확인 : 토폴리지가 구성되어서 통신이 되는지 확인 desktop → command line → ping [IP]

 

 

 

 

 

 

 

728x90

'네트워크 기초' 카테고리의 다른 글

20210527 (목) eigrp, ospf  (0) 2021.05.27
20210526 (수) rip, eigrp  (0) 2021.05.26
20210520 (목)  (0) 2021.05.20
20210514 wireshark  (0) 2021.05.14
20210510 (월)  (0) 2021.05.10
Comments