關於作業一的 traceroute

150 views
Skip to first unread message

陳少甫

unread,
Mar 29, 2020, 4:13:09 AM3/29/20
to NCTU NASA 課程討論區
在作業一中有 Traceroute: From Judge to Agent,但這項評分有些問題
作業要求中有
  "By default, all connections from outside (include Intranet) to your subnet should be rejected."
  "ICMP connections from anywhere to anywhere are allowed."
但是 Linux 的 traceroute 預設是用 UDP,且我藉由 tcpdump 得出的結果也是如此,和作業要求有衝突
因此traceroute會被防火牆設置DROP掉,導致該項評分沒過

陳少甫

unread,
Mar 29, 2020, 4:20:48 AM3/29/20
to NCTU NASA 課程討論區
附註一下:FreeBSD的traceroute也是預設UDP

陳少甫於 2020年3月29日星期日 UTC+8下午4時13分09秒寫道:

林宇翔

unread,
Mar 29, 2020, 4:31:29 AM3/29/20
to NCTU NASA 課程討論區
Traceroute是用ICMP封包,根據"ICMP connections from anywhere to anywhere are allowed.",ICMP封包應該要可以過,這跟UDP TCP應該沒有關係

陳少甫於 2020年3月29日星期日 UTC+8下午4時13分09秒寫道:

Sean

unread,
Mar 29, 2020, 4:52:29 AM3/29/20
to NCTU NASA 課程討論區, 林宇翔
Hi All,

幫補充一下 traceroute 的實現方式:

為了知道路徑上有哪些節點,traceroute 會發送 TTL 從 1, 2, 3 遞增的 UDP 封包至不存在的 port,當 TTL 變為 0 時,Router 會回傳 ICMP 訊息告知無法抵達目的地

如果成功送達目標主機,也會因為該 port 不提供服務而回傳 ICMP 錯誤訊息


因此除了回傳的 ICMP 要通之外,特定 UDP 封包也不能被擋下,否則後面主機連 UDP 都沒看到了,根本不會回傳 ICMP 封包


附上計網概的投影片
image.png

Best regards,
Sean

--
這是 Google 網上論壇針對「NCTU NASA 課程討論區」群組發送的訂閱通知郵件。
如要取消訂閱這個群組並停止接收來自這個群組的郵件,請傳送電子郵件到 nctunasa+u...@googlegroups.com
如要在網路上查看這項討論,請造訪 https://groups.google.com/d/msgid/nctunasa/b4d012c5-6e25-4753-ae80-0f310a5d7344%40googlegroups.com

柏毅蔡

unread,
Mar 29, 2020, 4:54:47 AM3/29/20
to NCTU NASA 課程討論區
如果加上 -I 的選項,好像就會強制使用ICMP

陳少甫於 2020年3月29日星期日 UTC+8下午4時13分09秒寫道:

Jui-Nan Lin

unread,
Mar 29, 2020, 4:55:45 AM3/29/20
to Sean, NCTU NASA 課程討論區, 林宇翔
Hi,

課程投影片p.48也有說明到喔



Sean <sean9...@gmail.com>於 2020年3月29日 週日,下午4:52寫道:
--
Sent from Gmail Mobile

陳少甫

unread,
Mar 29, 2020, 5:29:33 AM3/29/20
to NCTU NASA 課程討論區


加 -I 就真的ok,但Judge並沒有用啊…

柏毅蔡於 2020年3月29日星期日 UTC+8下午4時54分47秒寫道:

吳仲昇

unread,
Mar 29, 2020, 8:18:18 AM3/29/20
to NCTU NASA 課程討論區
同學們好

對不起助教我寫完腳本沒測試就去睡了,judge 的確要補上 -l 參數。
這個問題會在近期內修復。

Reply all
Reply to author
Forward
0 new messages