Broadcast on different subnets

陌路散爱 提交于 2019-12-13 00:58:57

问题


Please if you can help me about my problem. On one side I have server with IP 172.27.13.2 connected to the WAN interface of router 172.27.13.1 ...Then on wireless LAN of my router 192.168.1.1 I have connected a few clients. Now I will write code in C where client are requesting some UDP streams from server, then server broadcasts streams to clients, and if some packets get lost clients must send NACK to server. My questions is: Because server and clients are on different subnets how can I broadcast from server? And how the client can send request and NACKs to server because they are in different subnets? Are these problems can be solved by router configurations or in C code?

Thank you for helping


回答1:


You cannot broadcast to different subnets. Routers do not usually forward broadcast packets to different subnets, unless you have a very special router that can be configured properly (e.g. Cisco ...). You could however use multicast for such a task. Here's a C example

Also check this: UDP broadcast packets across subnets

NOTE: some includes in the c example are missing, but they are easy to find




回答2:


As both server & users are in different subnets .As router donot forward broadcast .But we have solution by modifying the router configuration . If you have cisco router & users are connected on cisco switch ,you can use ip helper address command on switch on vlan .You can allow udp packet on router ACL



来源:https://stackoverflow.com/questions/20947557/broadcast-on-different-subnets

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!