Japan QualNet Community Forums Japan QualNet Community Forums
Welcome Guest 
ログイン
ユーザ名:

パスワード:


パスワード紛失

新規登録
検索
メインメニュー
アクセスカウンター
2024/05/18:12/14
2024/05/17:19/24

2024/03/19より398/1408
人気モジュール
No.1: フォーラム 115
No.2: QualNet概要 4
No.3: ニュース 2
日曜日からの合計
人気Browser&OS
No.1:巡回ロボット90
No.2:Unknown OS1
No.3:Windows NT1

No.1:どっかの巡回ロボット81
No.2:Majestic-12巡回ロボット6
No.3:Google巡回ロボット3

日曜日からの合計
メイン
   Routing Protocols Implementation & Model Development
     データパケットのフラッディング
投稿するにはまず登録を

題名 投稿者 日時
   データパケットのフラッディング nanashi 2006/8/7 2:57
     Re: データパケットのフラッディング maxam 2006/8/7 9:56
       Re: データパケットのフラッディング nanashi 2006/8/7 17:18
       » Re: データパケットのフラッディング mast 2006/8/7 23:03
           Re: データパケットのフラッディング mast 2006/8/7 23:15
             Re: データパケットのフラッディング nanashi 2006/8/8 19:25
               Re: データパケットのフラッディング mast 2006/8/9 10:23
     Re: データパケットのフラッディング masa 2006/10/9 14:05
       Re: データパケットのフラッディング kabocha 2006/10/11 10:42
         Re: データパケットのフラッディング masa 2006/10/12 2:25
           Re: データパケットのフラッディング kabocha 2006/10/12 10:29
             Re: データパケットのフラッディング masa 2006/10/15 16:23
               Re: データパケットのフラッディング masa 2006/10/18 4:53
                 Re: データパケットのフラッディング forum_admin 2006/10/18 6:56
フラット表示 前のトピック | 次のトピック
投稿者 スレッド
mast
投稿日時: 2006/8/7 23:03
一人前
登録日: 2005/4/7
居住地:
投稿: 93
Re: データパケットのフラッディング
引用:
現在やろうとしていることは、1ホップ以内にいる全ノードにブロードキャストしたら、今度はそれらのノードが自分の通信範囲内の全ノードに対してブロードキャストを行い、これを繰り返すことでネットワーク全体に対してフラッディングが行われるというものなのですが、こういったことをするにはどうしたら良いのでしょうか?


ブロードキャストパケットならなんでもかんでも全てフラッディングしてしまうようにIPを改造する、という方法ではどうですか?全ノードがそのように動いてしまいますが、以下のようなアプローチで実現できるように思います。
(コードを読んだだけで動かしてはいないので、動くかどうかは分かりませんが。。)

一般に、IPレベルでのブロードキャストパケットの再ブロードキャストというのは、禁止されているはず。
なので、その禁止事項を取っ払えばブロードキャストパケットを再ブロードキャストしてくれるはず。
QualNetでその禁止ルールを適用している箇所は、ip.cppのNetworkIpReceivePacketFromMacLayer()の以下の箇所。(コードは3.9.5のもの)
03621     // IsMyPacket() determines whether the packet should be delivered or
03622     // forwarded.  IsMyPacket() checks multicast subscriptions as well
03623     // as the host and broadcast addresses of all local interfaces.
03624 
03625     if (IsMyPacket(node, ipHeader->ip_dst))
03626     {
03627         // Deliver IP packet to node.
03628         //
03629         // (We actually deliver a copy of the message instead of the
03630         // original.  This is in case the packet is multicast, one copy
03631         // of which is delivered, and the other copy, forwarded.)
03632 
03633         // Need to go through the backplane to the processor first before
03634         // deliverying data to higher layers...
03635         NetworkIpSendOnBackplane(node,
03636                                  MESSAGE_Duplicate(node, msg),
03637                                  incomingInterface,
03638                                  CPU_INTERFACE,
03639                                  previousHopAddress);
03640 
03641         //DeliverPacket(node, MESSAGE_Duplicate(node, msg),
03642         //              incomingInterface, previousHopAddress);
03643 
03644         if (NetworkIpIsMulticastAddress(node, ipHeader->ip_dst))
03645         {
03646             // Destination address is multicast address, so pass packet
03647             // to forwarding process for potential multicast routing.
03648 
03649             ForwardPacket(node, msg, incomingInterface, ANY_IP);
03650         }
03651         else
03652         {
03653             // Wasn't a multicast packet, so free message.
03654             //
03655             // [In my tests, the copy and free method happens to be 0.5%
03656             // faster than logic which copies only if necessary. -Jeff]
03657 
03658             MESSAGE_Free(node, msg);
03659         }
03660     }
03661     else
03662     {
03663         // Forward packet.
03664         ForwardPacket(node, msg, incomingInterface, previousHopAddress);
03665     }

なので、ここに、「ブロードキャストパケットはフォワードする」というルールを無理やり追加する。
03621     // IsMyPacket() determines whether the packet should be delivered or
03622     // forwarded.  IsMyPacket() checks multicast subscriptions as well
03623     // as the host and broadcast addresses of all local interfaces.
03624 
03625     if (IsMyPacket(node, ipHeader->ip_dst))
03626     {
03627         // Deliver IP packet to node.
03628         //
03629         // (We actually deliver a copy of the message instead of the
03630         // original.  This is in case the packet is multicast, one copy
03631         // of which is delivered, and the other copy, forwarded.)
03632 
03633         // Need to go through the backplane to the processor first before
03634         // deliverying data to higher layers...
03635         NetworkIpSendOnBackplane(node,
03636                                  MESSAGE_Duplicate(node, msg),
03637                                  incomingInterface,
03638                                  CPU_INTERFACE,
03639                                  previousHopAddress);
03640 
03641         //DeliverPacket(node, MESSAGE_Duplicate(node, msg),
03642         //              incomingInterface, previousHopAddress);
03643 
03644         if (NetworkIpIsMulticastAddress(node, ipHeader->ip_dst))
03645         {
03646             // Destination address is multicast address, so pass packet
03647             // to forwarding process for potential multicast routing.
03648 
03649             ForwardPacket(node, msg, incomingInterface, ANY_IP);
03650         }
              else if (destAddress == ANY_DEST)
              {
                  // Destination address is broadcast address, BUT pass packet
                  // to forwarding process.
      
                  ForwardPacket(node, msg, incomingInterface, ANY_IP);
              }
03651         else
03652         {
03653             // Wasn't a multicast packet, so free message.
03654             //
03655             // [In my tests, the copy and free method happens to be 0.5%
03656             // faster than logic which copies only if necessary. -Jeff]
03657 
03658             MESSAGE_Free(node, msg);
03659         }
03660     }
03661     else
03662     {
03663         // Forward packet.
03664         ForwardPacket(node, msg, incomingInterface, previousHopAddress);
03665     }

フラット表示 前のトピック | 次のトピック
Copyright c KOZO KEIKAKU ENGINEERING Inc. All Rights Reserved.
XOOPS Cube PROJECT