Q:
- Write a computer program that simulates a bridge function. Let two files of data simulate frames transmitted on two LAN segments to which the bridge is connected. To simulate frame transmission, read a fraem from the first file, then a frame from the second file, and so on. For each frame, show whether a bridge will forward a copy of the frame to the other LAN segment.
- Each row in the data files will contain 5 characters:
- (U,V): U sends to V
- (Z,-): Z broadcast
兩邊都有一個data file, 每個raw用五個字元代表傳送端和接收端。e.g. (U,V) (Z,-)
每個file要有幾個raws 才夠?(夠的意思是,bridge要學完?)
Ans:幾個都可以,之前是我理解錯誤。
老師說共有A-Z個nodes, 所以一邊會有十三個nodes(不是很確定...)
Ans:兩邊的nodes 是由test data file 決定。
撰寫的語言是否限定為C語言?
Ans:應該是。不然的話,請給助教readme file, 說明如何編譯你的程式。
Note:
交替讀取兩邊的frame data file的用意是,簡化程式流程,不然要真正達到現實生活中的情境,就得參考資料結構中的spanning tree或者在每個frame data raw前加入timestamp欄位。
沒有留言:
張貼留言