[Ch6] Link Layer

2024. 1. 14. 22:48· CS/컴퓨터네트워크
목차
  1. Link Layer Services
  2. Link Layer
  3. Link Layer Services
  4. Multiple Access Link
  5. Multiple Access Link: 2 Typs of Link
  6. Multiple Access Protocol
  7. MAC addresses and ARP
  8. IEEE 802 Standard
  9. MAC Address (or LAN address)
  10. ARP: Address Resolution Protocol

Link Layer Services

Link Layer

  • 1 subnet & 4 L2-switch (no IP addr, no MAC addr)

Link Layer (Layer 2)

  • nodes: hosts and routers
  • links: communication channels that connect adjacent nodes along communiation path - wired & wireless links
  • layer-2 packet == frame that encapsulates datagram

Data Link Layer (Layer 2) has responsibility of transferring datagram from one node to physically adjacent node over a link (each node has L3)

 

Where is the Link Layer Implemented

  • Link layer is implemented in each and every host in adapter (aka. network interface card; NIC)
    • Ethernet card(802.11)
    • implements link, physical layer
  • Link layer is combination of hardware, software, firmware

 

Link Layer Services

Framing

  • encapsulate datagram into frame, adding header (src/dst MAC addr)

Link Access

  • channel access if shared medium

Reliable delivery btw adjacent nodes

  • flow control: pacing btw sending & receiving nodes
  • error detection: receiver detects presense of errors and signals sender for retransmission or drops frame
  • error correction: receiver identifies and corrects bit errors without resorting to retransmission

Multiple Access Link

Multiple Access Link: 2 Typs of Link

Point-to-Point networks (typically WAN)

  • pairs of host (or routers) directly connected
  • ex) p2p link btw Ethernet switch and host

Broadcast networks (typically LAN)

  • all hosts (or routers) share a single communication channel
  • ex) old fashioned Ethernet, Wi-Fi, Satellite networks, HFC (Hybrid fiber-coaxial cable)
  • L2 Switch: Buffer O -> 포트마다 다른 BW 가지는 링크 연결 가능
  • Hub: Buffer X -> flooding, 모든 포트에 연결된 링크의 BW가 동일해야 함

Multiple Access Protocol

Due to a single shared broadcast channel:

👉 two or more simultaneous transmissions by nodes: interference

👉 collision if node receives two or more signals at the same time

👉 Why we need Multiple Access Protocol

 

Multiple Access Protocol

  • distributed algorithm that determines how nodes share channel (i.e. determine when node can transmit)
  • channel particioning
    • by time (TDMA), frequency (FDMA) or code (CDMA)
  • random access (dynamic)
    • Collision Detection (CD): CSMA/CD used in Ethernet (IEEE 802.3)
    • Collision Avoidance (CA): CSMA/CA used in 802.11 (Wi-Fi)
  • taking turns
    • bluetooth, FDDI, token ring

Collision Detection (CSMA/CD)

  • transmission time (L/R) 동안 listen -> collision detection 가능

Collision Avoidance (CSMA/CA)

  • CTS, RTS 보내서 충돌이 일어나지 않도록 선점
  • AP 하고만 통신 -> detection 불가 (Hidden node problem)

Hidden node problem: wireless network에서 두 노드 A, B가 공통으로 통신이 가능한 노드 P가 있는데 A와 B는 통신 거리(radio range) 밖에 있거나 두 노드 사이에 장애물이 있어 서로의 신호가 P에서 충돌하는 것을 감지 (Collision Detection)할 수 없는 현상


MAC addresses and ARP

IEEE 802 Standard

IEEE 802

  • a family of standards for LANs which defines
    • Logical Link Control (LLC) - OS
    • Several Media Access Control (MAC) sub-layers - HW, NIC

 

MAC Address (or LAN address)

32-bit IPv4 address

  • Network Layer (L3) address for interface used for layer 3 forwarding

MAC address (== LAN or physical or Ethernet address)

  • 48-bit MAC address burned in NIC
  • permanent, unique, IEEE manages the MAC address space
  • no hierarchical structure (same MAC address can be used no matter where the computer goes)
  • 16진수로 표현 (ex. FF-FF-FF-FF-FF-FF: broadcast MAC addr)
  • 두 호스트를 연결하는 e2e path에서 경유하는 라우터들은 모두 동일한 src IP addr와 dst IP addr를 보고 라우팅을 결정한다.
  • 어떤 NIC 카드에 할당된 L3 IP 주소는 위치에 따라 변하는 주소이나, L2 MAC 주소는 변하지 않는다.
  • IP address = postal address / MAC address = social security number

ARP: Address Resolution Protocol

ARP Table

  • each IP node (host, router) on LAN has ARP table
    • 특정 NIC에 설정된 IP address와 MAC address의 매핑 테이블
    • <IP addr; MAC addr; TTL>
    • TTL (Time to Live): time after which address mapping will be forgotten (typically 20 min)

In case of Same LAN (A wants to send datagram to B & B's MAC address not in A's ARP table)

  • A broadcasts ARP query packet, containing B's IP address
    • broadcast: dest MAc address = FF-FF-FF-FF-FF-FF
    • all nodes on LAN receive ARP query
  • B receives ARP pkt and replies to A with its (B's) MAC address
    • frame sent to A's MAC address (unicast)
  • A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (time out)
    • <IP addr; MAC addr; TTL>
  • ARP is plug-and-play
    • nodes create their ARP table without intervention from network administrator

In case of Routing to another LAN

  • walkthrough: send datagram from A to B via R
    • 두 host를 연결하는 e2e path에서 한 hop을 지날 때 2계층 주소는 계속 바뀌지만 3계층 주소는 동일

 

저작자표시 (새창열림)

'CS > 컴퓨터네트워크' 카테고리의 다른 글

[Ch5] ICMP, SDN, SNMP  (0) 2024.01.01
[Ch5] Hierarchical routing, RIP, OSPF, BGP  (1) 2023.12.31
[Ch5 Network Layer Control Plane] Routing Algorithm: Link State, Distance Vector  (0) 2023.12.25
[Ch4] IPv6, SDN  (0) 2023.12.19
[Ch4] IPv4, Network Address Translation(NAT)  (1) 2023.12.03
  1. Link Layer Services
  2. Link Layer
  3. Link Layer Services
  4. Multiple Access Link
  5. Multiple Access Link: 2 Typs of Link
  6. Multiple Access Protocol
  7. MAC addresses and ARP
  8. IEEE 802 Standard
  9. MAC Address (or LAN address)
  10. ARP: Address Resolution Protocol
'CS/컴퓨터네트워크' 카테고리의 다른 글
  • [Ch5] ICMP, SDN, SNMP
  • [Ch5] Hierarchical routing, RIP, OSPF, BGP
  • [Ch5 Network Layer Control Plane] Routing Algorithm: Link State, Distance Vector
  • [Ch4] IPv6, SDN
호프
호프
호프
Untitled
호프
전체
오늘
어제
  • 분류 전체보기 (341)
    • 오류😬 (4)
    • 스터디📖 (96)
      • 웹 개발 기초 (8)
      • Spring (20)
      • ML, DL (30)
      • Node.js (22)
      • React (0)
      • 블록체인 (12)
      • Go (3)
      • Javascript (1)
    • 알고리즘💻 (153)
      • 그리디 (23)
      • Bruteforce&Backtracking (16)
      • DP (17)
      • 이분탐색&정렬&분할정복 (17)
      • 누적합&투포인터 (6)
      • 스택&큐&덱 (19)
      • 그래프(DFS&BFS) (19)
      • 트리 (7)
      • 우선순위큐&다익스트라 (11)
      • 벨만포드&플로이드와샬 (8)
      • map&set&number theory (5)
      • 기타 (5)
    • 프로젝트 (3)
      • 캡스톤 디자인 프로젝트 (3)
    • 블록체인🔗 (3)
      • Solana (2)
      • 개발 (0)
      • Harmony (1)
    • ASC (6)
    • CS (73)
      • 데이터베이스 (12)
      • 클라우드컴퓨팅 (21)
      • 운영체제 (11)
      • 컴퓨터네트워크 (14)
      • 블록체인응용 (15)

블로그 메뉴

  • 홈
  • 태그
  • 방명록

공지사항

인기 글

태그

  • 복습

최근 댓글

최근 글

hELLO · Designed By 정상우.v4.2.1
호프
[Ch6] Link Layer
상단으로

티스토리툴바

단축키

내 블로그

내 블로그 - 관리자 홈 전환
Q
Q
새 글 쓰기
W
W

블로그 게시글

글 수정 (권한 있는 경우)
E
E
댓글 영역으로 이동
C
C

모든 영역

이 페이지의 URL 복사
S
S
맨 위로 이동
T
T
티스토리 홈 이동
H
H
단축키 안내
Shift + /
⇧ + /

* 단축키는 한글/영문 대소문자로 이용 가능하며, 티스토리 기본 도메인에서만 동작합니다.