473,396 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Q: Change ProtocolType of a Socket?

I am opening a socket and doing a TraceRoute to a server online, the
result of this is that I successfully identify the NAT server I am
going through as gateway.

In the next step I would like to know which port I have been mapped to
on this NAT. I plan to scan from the inside (local source routing)
sending packages to "the potential ports" on the public IP I just
uptained. The result thus being that (eventually) I will know which
public IP and port I have been assigned to by the NAT.

The question is then. Can I "convert" my socket to use another
protocol than the ICMP I have used for the pinging? I can not create a
new socket as this would assign to a new IP/port leaving me back where
I started. Unfortunately in C# setting .ProtocolType is a read-only
property. :(

Am I trying the impossible here? It would ofcourse be best if I can
accept TCP connections on my socket but if UDP is the only solution
then that's ok.

---
s = new Socket(AddressFamily.InterNetwork, SocketType.Raw,
ProtocolType.Icmp);

// Illigal
s.ProtocolType = ProtocolType.Tcp;
---


Suggestions would be greatly appreciated,
Thanks in advance,
Casper Bang, Denmark.

PS: The technique I am trying to implement is known as "UDP hole
punching" in RFC
Nov 15 '05 #1
0 1092

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Chuck E. Cheese | last post by:
I need a php page to connect to a python created socket and sent and receive data. below is the python code which opens a socket on the localhost @ port 21567: #!/usr/bin/python2 from socket...
8
by: simon place | last post by:
Spent some very frustrating hours recoding to find a way of closing a server socket, i'd not thought it would be any problem, however, after complete failure and as a last resort, i looked at the...
3
by: Thomas Hervé | last post by:
My problem is not really python specific but as I do my implementation in python I hope someone here can help me. I have two programs that talk through a socket. Here is the code : <server>...
4
by: DreJoh | last post by:
I've read many articles on the subject and the majority of them give the same solution that's in article 821625 on the MSDN website. I'm using the following code and when a the client disconnects...
6
by: roger beniot | last post by:
I have a program that launches multiple threads with a ThreadStart method like the following (using System.Net.Sockets.Socket for UDP packet transfers to a server): ThreadStart pseudo code: ...
2
by: centrino | last post by:
hi, I want to extend System.Net.Sockets.ProtocolType to IPinIP protocol, how can i do that. Do i have to make new class or enum stuct for this type ? regards
0
by: laredotornado | last post by:
Hi, I have both MySQL 5 client and server running on a Linux Fedora Core 5 machine (x86 Desktop PC). Regarding hte client, what can I do to change the default socket location? Right now, I'm...
9
by: =?Utf-8?B?aXdkdTE1?= | last post by:
Hi, im making an AIM like server using TCP sockets, however i found a big issue. when a socket is connected to (socket.EndAccept(ar)), its already bound to a Port. since its bound, i cannot change...
9
by: KDawg44 | last post by:
Hi, I am brand new to Python. In learning anything, I find it useful to actually try to write a useful program to try to tackle an actual problem. I have a syslog server and I would like to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.