Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chap 1 Foundation Broadcasting Chap 20.

Similar presentations


Presentation on theme: "Chap 1 Foundation Broadcasting Chap 20."— Presentation transcript:

1 Chap 1 Foundation Broadcasting Chap 20

2 Introduction Use of broadcasting
to know server address on the local subnet: resource discovery to minimize network traffic on a LAN Internet applications ARP(Address Resolution Protocol) BOOTP(Bootstrap Protocol) NTP(Network Time Protocol) Routing daemons: broadcast routing table

3 Broadcast Addresses Subnet-directed: [subnetid, -1]
Normally routers do not forward these broadcasts most commonly used today E.g.) ping Limited broadcast: must not forwarded by a router Some systems do not understand a subnet-directed broadcast address and only interpret as a broadcast TFTP and BOOTP use this address to know IP address of its diskless workstation on bootstrapping procedure

4 Unicast versus Broadcast

5 dg_cli Function using Broadcasting
Before broadcasting, set SO_BROADCAST socket option const int on = 1; setsockopt(sockfd, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on)); First example dg_cli: Figure 20.5 bcast/dgclibcast1.c SIFALRM signal이 blocked system call(recvfrom)이외에서 deliver되면 loop을 빠져 나오지 못함 Race Condition: shared data를 여러 process들이 동시에 access할 때 time-dependent error 발생 Case 1: shared data(global variable) among threads Case 2: dealing with signals  signal handler도 일종의 thread로 봐야 dg_cli with blocked signal: Figure 20.6 bcast/dgclibcast3.c Still has race condition problem

6 dg_cli Function that broadcasts
bcast/dgclibcast1.c 문제점 SIFALRM signal이 blocked system call(recvfrom)이외에서 deliver되면 loop을 빠져 나오지 못함 Race Condition: shared data를 여러 process들이 동시에 access할 때 time-dependent error 발생 Case 1: shared data(global variable) among threads Case 2: dealing with signals  signal handler도 일종의 thread로 봐야

7 Correct Solutions for Avoiding Race Condition
bcast/dgclibcast5.c


Download ppt "Chap 1 Foundation Broadcasting Chap 20."

Similar presentations


Ads by Google