If I have three static send port say A , B and C .suppose if I received a file via port A if successful file should go to SEND PORT B else C Port - biztalk

If I have three static send port say A , B and C .suppose if I received a file via Send port A if successful file should go to SEND PORT B else C Port without Orchestration.

Related

how to know what port is used to make http Get request from Postman

how to know what port is used to make http Get request from Postman?
I made this http Get request for example:
http://127.0.0.1:3000/
This request got through to the destination and the client could get response.
You can goto console >network >remote address to know the IP and port of the destination
if you goto localaddress , it shows the network through which it will connect to the destination (Meaning the subnet network ) like wireless network , vlan network etc.
You can goto cmd and type ifconfig or ipconfig and verify this

How to route back to original interface

Sorry, my networking skills are subpar,
I have a scenario where I have 2 different networks and have 2 servers in those networks, server A is in network A, server B in network B
When someone tries to connect to an external server (over internet), we have a virtual interface configured between A & B (IPIP tunnel)
1)
If I try to netcat/telnet external server (x.x.100.3), I have a route on serverA that routes to my virtual inteface (tunnel1)
2) tunnel1 sends packets over IPIP tunnel to its peer "tunnel2"
3) I need to route any requests to x.x.100.3 over to another internet-facing p1p1 interface
4) serverB sends packets to external serverC over p1p1 interface (I tested running tcpdump -i p1p1 and can see the packets going out
5) reply from C comes back to p1p1
If I do the same netcat cmd from B, I get connected. Yet from A, I get a timeout.
SO my question is, how do I configure this setup so the user who initiates Netcat on server A, gets the reply from server C? Right now the connection stops at server B (p1p1) because the packet header is changing after the Route on B.
I tried playing with iproute2 table rules but cannot get it to work. I basically need to use Server B as a "proxy" network server for any requests going to external server C.
Thanks!
figured out the problem, I didnt have a gateway route in place. This was preventing the back-forth flow of packets.
heres the write up how to setup IPIP tunnel between 2 networks,
https://sites.google.com/site/mrxpalmeiras/linux/create-ipip-tunnel-between-networks

Communication between 2 ESP8266 WiFi modules without router using AT commands

I'm trying to make a TCP based communication to send a simple message "Hello" from one ESP8266 module to another using this document. I'm using 2 USB to TTL as hardware and Realterm as serial terminal.
I could do it when ESP8266 modules are connected to a router, sending AT commands as below,
Set the Server:
AT+CWJAP="AccessPointName","Password"//Join to your WiFi network
AT+CIPMUX=1//0 for single connection 1 for multiple connection.
AT+CIPSERVER=1,1336//Set as Server. 1 to open Server mode(0 to close). 1336 is port.
AT+CIFSR//Get IP address (STAIP 192.168.43.151)
Set the Client:
AT+CWJAP="AccessPointName","Password"
AT+CIPMUX=1
AT+CIPSTART=1,"TCP","192.168.43.151",1336//Set up TCP or UDP connection, the 4 parameters are id, type, adress and port.
AT+CIPSEND=1,7// Channel and number of bytes to send
//After issuing all previous command you will receive "OK". But afterAT+CIPSENDyou will receive a ">" as response.
Hello//send your Data
I want to connect both ESP8266 to each other without a router.
So I used these AT commands:
Server commands:
AT+CIPMUX=1
AT+CWMODE=3//set the module as a client and also an access point.
AT+CIPSERVER=1,1336
AT+CIFSR //Getting 2 ip address (APIP 192.168.4.1 and STAIP 0.0.0.0).
Client commands:
AT+CIPMUX=1
AT+CWMODE=3
AT+CWJAP="ESP1 SSID", "ESP1 PWD" //Connect to server
AT+CIPSTART=1,"TCP","0.0.0.0",1336 // I also tried APIP 192.168.4.1.
But when I send CIPSTART command I get ERROR message.
What's going wrong? What should I do?
In the context of a route entry, the 0.0.0.0 means the default route. In the context of servers, 0.0.0.0 means all IPv4 addresses on the local machine. If a host has two IP addresses, 192.168.1.1 and 10.1.2.1, and a server running on the host listens on 0.0.0.0, it will be reachable at both of those IPs. This type of communication is also known as WiFi P2P or Wifi direct. It should work properly with your commands! If problem persists try with different modules.
I changed modules and it's working now.
The Server Commands:
AT+CWMODE=3
AT+CIPMUX=1
AT+CIPSERVER=1,222
AT+CIFSR
/*the server response to CIFSR is:
+CIFSR:APIP,"192.168.7.7"
+CIFSR:APMAC,"a2:20:a6:10:50:2c"
+CIFSR:STAIP,"0.0.0.0"
+CIFSR:STAMAC,"a0:20:a6:10:50:2c"*/
The Client commands:
AT+CWMODE=3
AT+CWJAP="SERVER_SSID","SERVER_PASS"
AT+CIPMUX=1
AT+CIPSTART=2,"TCP","192.168.7.7",222
AT+CIPSEND=2,7
HELLO

udp hole punch and port restricted cone NAT,

I would like to understand how udp hole punching works when two hosts each behind the port restricted cone NAT establish connection.
As I understood, it happens in several stages and involves three hosts.
Host A and host B are behind the port restricted cone NAT.
Host C is a server that can receive packets from the hosts A and B.
A sends a packet to C.
C receives packet from A and determines A's external address:port pair
B sends a packet to C.
C receives packet from B and determines B's external address:port pair
C sends the external address:port of B to A
C sends the external address:port of A to B
A sends packet_1 to B's external address
B sends packet_2 to A's external address
But I can't do it。it's the window,Who can tell me why?
in the golang
Only
net.ListenUDP() 's UDPConn can use the method WriteToUDP()
net.DialUDP 's UDPConn can't //
Sorry my English is very poor。
I think maybe nobody can read this。
囧TZ

UDP hole punching for Server/Client communication under NAT with STUN

Problem
I'm trying to develop a communication system where:
A, B are machines under NAT, A is the server B is the client
S is the STUN server
S is running on a machine reachable on the Internet
The flow is as follows:
A hits S with an opcode saying he's the server
S registers A as server
B hits S with an opcode saying he's the client
S sends to A B's external infos (IP, PORT)
S sends to B A's external infos (IP, PORT)
A starts sending B an opcode saying he's the server every 500ms
and meanwhile listens for packets saying he's got a client
B starts sending A an opcode saying he's the client every 500ms
and meanwhile listen for packets saying he's got the server
Trouble
Here's where the troubles start, the STUN server does its job, since both ends receive correct infos about the other.
But then I do never receive the other end's message, so both ends keep listening without receiving the handshake opcode nor anything else.
NAT's Behaviour
I did examine this NAT's behaviour and seems it does like this
A is at 192.168.X.X, on port 4444
connects to the outside exposing N.N.N.N:4444
so the port number is kept as long as it's free, gets a new (random ?) one if not available.
Tests
The tests I run have seen both ends (A, B) hosted on the same machine, both bound to the machine's internal IP, tried to bind to 127.0.0.1, 0.0.0.0, nothing changed.
If while they're listening for handshakes I echo something with nc to localhost, it is received and displayed (as an unrecognised message) without any problem. The connection routed via the NAT doesn't wotk tough, every packet is discarded.
Also tried with A hosted on the machine, B on an Android phone under mobile data, with a simple app written ad-hoc. Still locks waiting for something, like the nodejs tests.
Update:
Another thing I tried to do is to open an hole with nc
On two different machines under the same NAT I ran:
echo "GREET UNKOWN PEER" | nc -u <NAT IP> 4567 -p 4568
echo "GREET UNKOWN PEER" | nc -u <NAT IP> 4568 -p 4567
Different times for each machine. From my understanding this should punch an hole in the NAT with the first packets discarded and the subsequent forwarded. But nothing happened, no end got the message.
I've also tried:
from local machine
echo "GREET UNKOWN PEER" | nc -u <PUBLIC IP> 4567 -p 4568
from public machine
echo "GREET UNKOWN PEER" | nc -u <NAT IP> 4568 -p 4567
this one works, the local machine under NAT contacts the public one and after the first discarded packet is able to receive and send on the assigned port. I wonder why this doesn't work on two machines under the same NAT (???)
Code
I didn't show any code because I think there is some kind logic flaw in this, however here's the github project for that.
index.js contains the STUN server, the tests folder contains the test cases: test.js starts the stun server, PeerClientTest.js and PeerServerTest.js are mockups of the client and server.
Run node tests/test.js to start the server on a public machine (change IPs in config.js and tests/config.js)
then node tests/PeerServerTest.js to start the server ("A") and node tests/PeerClientTest.js to start the client ("B"). Both will recognize each other via STUN, then listen for the other end's handshake opcode while sending their own handshake opcode. This never happens so they just keep sending/listening forever.
Node is not required, so if there are better solutions in other languages just tell, will be appreciated.
B's NAT is filtering A's packets and is not letting them through. NAT filters unknown packets sent to it. Your server A is sending packet to client B. But client B previously never sent a packet through NAT to A. So to B's NAT A's packets are unknown and being discarded.
You need to punch a hole in B's NAT for the NAT to allow the incoming packets. Send a packet from B to A NAT's IP:Port. After that when you send a packet from A to B, B's NAT won't discard A's packet.
This won't work if A and B's NAT has a combination like Symmetric and Symmetric/PRC NAT. In this case you will have to use a TURN relay server.

Resources