Sockets and ports - routing messages between machines? helpppp!

Hi,
I'm new to java and am hoping someone out there can help me, hoping this is an ok place to post this:
If all you need to create a connection is an IP address and a port number, using streams...
Can you route messages from A to B then from B to C, where A looks up C through B having a hash table which contains C's IP address and port number?
And how in the first instance does B know about A's IP address? All the examples I've seen the IP address is hard coded?
Thanks in advance!

I'm not sure what you are really trying to do... Can you explain in more concrete terms? Are you writing a chat client + server or something like that?

Similar Messages

  • L2 and L3 Routed Link between 2 COREs

    Hi
    What is the difference between L2 (Dot1q) and L3 Routed Link between 2 COREs in term of Functionality 
    thanks

    Hello Ibrahim ,
    I will try to explain , 
    VLANs put tag on frames to ensure packet do not leave layer 2 broadcast domain and yet will reach to all ports part of that vlan ( as per tag ) .
    Layer 3 SVIs on other hand provides layer 3 reachability for vlans and hosts inside layer 2 vlan . To achieve this all layer2 vlan host provide with related layer 3 SVIs ip address as gateway .
    I hope you got it by now . 
    HTH
    Sunil Bhadauria 
    ! Kindly rate all helpful posts  and accordingly mark correct answers to help forum !

  • Sockets and ports - how to route through another machine?

    Hi,
    I'm hoping someone out there can help me:
    If all you need to create a connection is an IP address and a port number, using streams...
    Can you route messages from A to B then from B to C, where A looks up C through B having a hash table which contains C's IP address and port number?
    And how in the first instance does B know about A's IP address? All the examples I've seen the IP address is hard coded?
    Thanks in advance!

    Ok, so i mean I know this is possible, but I have some users who need to communicate with each other, sorta a message passing approach but with TCP rather than using JMS (time to do this in is v limited).
    They need to talk to a middle computer, whos job it is to lookup an appropriate partner to talk to, but:
    how do i go about getting the IP address in the first place so that they know who to talk to?
    Before communication can take place does there have to be some agreement in which they exchange IP addresses and port numbers?

  • Dual Wan and port routing

    Hi,
    I am setting up a configuration with SA520W and 2 Wan, in load balancing. But I face a problem that I could not understand.
    Traffic is HTTP, SIP and 2 servers.
    Servers are for a VPN tunnel and a mail server with ActiveSync
    Both services absolutely need port 443 on the external IP, and that's one of the dual wan reason.
    The 2 wan are running, load balancing mode is enable and NAt routing in firewall tab as follow :
    443  Enabled     WAN     LAN     ALU_OpenVPN     ALLOW always     Any         192.168.0.150     WAN1     Always    
    443   Enabled     WAN     LAN     ActiveSync     ALLOW always     Any         192.168.0.254     WAN2     Always 
    If load balanced
    Port 443 is NOT routed from wan1 to 192.168.0.150
    Port 443 is routed from wan2 to 192.168.0.254
    If only WAN 1
    Port 443 is routed  from wan1 to 192.168.0.150
    If only WAN 2
    Port 443 is routed  from wan2 to 192.168.0.254
    In fact I did other testing and no port routing with WAN1 when load balancing is enable, even on port that is not used at all on Wan2.
    With a FTP filezilla server, it's OK if on wan2, and it stop before logging if on a wan1 (on laod balancing, ok on both case if only one wan)
    Firmware : latest 2.1.18
    Any Clue ??

    Hello,
    I confirm, there is a strange behaviour.
    Simple test :
    Dual Wan configured.
    A FTP server on the LAN (192.168.0.254) port 21
    Firewall , ipv4 config :
    WAN   to   LAN     FTP     ALLOW always     Any         192.168.0.254     WAN1
    WAN   to   LAN     FTP     ALLOW always     Any         192.168.0.254     WAN2
    Then some testing using a FTP client outside the LAN, connection from Internet.
    Then, changing ONLY the Wan Mode :
    1/ Use only single WAN port : Dedicated WAN
    ==> FTP connect through WAN1
    2/ Use only single WAN port : Optional WAN
    ==>FTP connect through WAN2
    3/ Load Balancing
    ==>FTP connect through WAN1
    ==>FTP DO NOT connect through WAN1
    Is that a bug or do I have some strange stuff somewhere ?
    I will pick up another SA520W from stock, brand new, update the firmware, configure the 2 WAN (invering the 2 provider just in case) and do the same test.

  • Whats socket and port ??

    Hi,
    iam new to sockets...
    i dont know whats the difference between sockets and ports

    http://java.sun.com/docs/books/tutorial/networking/sockets/definition.html

  • Chatserver socket and port problem

    hi,all.
    i write a chat server use java socket. now is more than 2000 users connect to my server. but too many user make the chat message speed slow. now my server is open one port to listen the client connection. who can tell me if i change my server to open multi port to listen the client connection will rather than open one port. or it is same effect.
    please give me some advice. thanks.
    my homepage is:http://www.easyfad.com

    my server system resource is no problem. Have you timed the bus on your machine?
    18% of memory means physical or total. If total is that 18% hitting the hard drive?
    What is your actual network speed? A 100m ethernet has a theoretical speed of about 12 meg per second, in practice you will never get even close to that. A normal ftp transfer might only get 500k per second. And networks can be significantly overloaded.
    What are the configuration parameters for your IP stack? It might be configured incorrectly for the type of traffic and quality of traffic that you are getting.
    The above are all possible things that can affect performance. And there are probably more. Standard OS tools are NOT the best way to measure platform performance. They can often provide misleading numbers, even when one knows what the numbers really mean.
    if i use multi port to create socket connection,
    if it will help to increase message sending speed ? Like I said I can't see how. Something is causing a slowdown. Your NIC can only process so much traffic. If your NIC was the bottle neck and you had two NICs then that would help. But if it was me I really wouldn't try a two NIC solution until I had exhausted every other possibility. First because it is unlikely to the be bottleneck and two because setting up a 2 NIC (or more) server is not plug and go solution.

  • About socket and port problem

    hi,all.
    i write a chat server use java socket. now is more than 2000 users connect to my server. but too many user make the chat message speed slow. now my server is open one port to listen the client connection. who can tell me if i change my server to open multi port to listen the client connection will rather than open one port. or it is same effect.
    please give me some advice. thanks.

    Maybe your machine is not strong enough to serve that many users at a time anyway. In that case using several ports won't help.

  • Socket and PORT problem

    I am new to socket programming. Is there a command in UNIX to see which ports are not occupied?
    Since I have problem right now in my program to close the sockets, will they be closed automatically after I interrupt the program, should I close it manually from the command line?
    TIA.
    mmc

    When you create a Socket, you can either bind to port 0 (which binds to the first available port) or to any other valid Port number. There is no Java-based method for geting the port numbers in-use or available. When your program terminates, the sockets will terminate as well, but the port may not be available for use for a few seconds. This allows for the system to be reset.

  • Sockets and Ports and DataInputStreams

    I think this is just a basic TCP/IP networking question: When I open a socket connection to a remote ip address/port, what port am i receiving data on via my DataInputStream? Is it the same port I opened the remote connection on, 80, or what?
    thanks,
    Abraham

    int answer = yourSocket.getLocalPort();

  • If I delete someone from my contacts and a text message is that message also deleted from contact?

    If I delete someone from my contacts and a text message between us is that message also deleted from person(contact) I deleted?

    I think you are asking if you delete a message on your device, does that delete it on the other person's device? Is that what you are asking?
    The answer to that would be No.

  • After mail was moved to iCloud on jan 1, my mail app emails received have 23 lines of "routing info" between the address and the message. How can I get rid of this info?

    After my mail was moved to iCloud, my mail app emails received have 23 lines of "routing data between the address and the message how can Imget rid of this "data"?

    Found the answer a Mail>preferances>Viewing>Show header detail. Changed it to Default.

  • Whats the difference between sending messages via socket and MQs?

    Whats the difference between sending messages via socket and MQs?

    Soph wrote:
    Whats the difference between sending messages via socket and MQs?With JMS (and the like) your application uses a socket to connect to a central server called a "*Message Broker*". Over this connection it can send or receive messages.
    A Message Broker is somewhat analogous to a database server. Multiple clients connect to it to exchange messages. As with a database a client first establishes a connection, then requests specific facilities like subscriptions.
    It creates a strong decoupling between sender and receiver and handles stuff like allowing multiple receivers for the same message, queuing of messages for applications not currently running and so on.
    (And don't worry, you can get perfectly good message brokers for free such as openMQ and activeMQ.)

  • Question in ACS radius ports and how test connectivity between router

    hi all
    im asking here about default ports used in cisco acs for radius protocol
    is it 1812 and 1813 ???
    or there is another ports ??
    Q2-
    how to test connectivity between ACS "server aaa"  and the router "client aaa " ??????
    Q3-
    can anyone give me simple config on router for radius protocol to connect acs based on radius protocol ?
    regards

    The default authentictaion port is 1812 and the default accounting port is 1813.
    Here's an example config-
    aaa new-model
    aaa group server radius ACME-RADIUS
    server-private 192.168.1.5 auth-port 1812 acct-port 1813 key SeCrEtPaSsWoRd
    aaa authentication login default local
    aaa authentication login ACME-AAA group ACME-RADIUS local
    aaa accounting send stop-record authentication failure
    aaa accounting exec default start-stop group ACME-RADIUS
    line vty 0 4
    login authentication ACME-AAA
    You can test with-
    test aaa group radius server 192.168.1.5 mmessier St@nleyCup
    where mmessier is your username and the password is St@nleyCup

  • Site-to-Site VPN between Cisco ASA 5505 (8.4) and Cisco Router (IOS 15.2)

    Hi, I'm trying to create Site-to-Site VPN between Cisco ASA 5505 and Cisco Router 3945.
    I've tried create configuration with and without ASA wizard, but anyway it doesn't work.
    Please help me to find where is the issue.
    I have two sites and would like to get access from 192.168.83.0 to 192.168.17.0
    192.168.17.0 --- S1.S1.S1.S1 (IOS Router) ==================== S2.S2.S2.S2 (ASA 5505) --- 192.168.83.0
    Here is my current configuration.
    Thanks for your help.
    IOS Configuration
    version 15.2
    crypto isakmp policy 1
    encr aes 256
    authentication pre-share
    group 2
    crypto isakmp key cisco address 198.0.183.225
    crypto isakmp invalid-spi-recovery
    crypto ipsec transform-set AES-SET esp-aes esp-sha-hmac
    mode transport
    crypto map static-map 1 ipsec-isakmp
    set peer S2.S2.S2.S2
    set transform-set AES-SET
    set pfs group2
    match address 100
    interface GigabitEthernet0/0
    ip address S1.S1.S1.S1 255.255.255.240
    ip nat outside
    ip virtual-reassembly in
    duplex auto
    speed auto
    crypto map static-map
    interface GigabitEthernet0/1
    ip address 192.168.17.1 255.255.255.0
    ip nat inside
    ip virtual-reassembly in
    duplex auto
    speed auto
    access-list 100 permit ip 192.168.17.0 0.0.0.255 192.168.83.0 0.0.0.255
    ASA Configuration
    ASA Version 8.4(3)
    interface Ethernet0/0
    switchport access vlan 2
    interface Vlan1
    nameif inside
    security-level 100
    ip address 192.168.83.1 255.255.255.0
    interface Vlan2
    nameif outside
    security-level 0
    ip address S2.S2.S2.S2 255.255.255.248
    ftp mode passive
    same-security-traffic permit intra-interface
    object network inside-network
    subnet 192.168.83.0 255.255.255.0
    object network datacenter
    host S1.S1.S1.S1
    object network datacenter-network
    subnet 192.168.17.0 255.255.255.0
    object network NETWORK_OBJ_192.168.83.0_24
    subnet 192.168.83.0 255.255.255.0
    access-list outside_access_in extended permit icmp any any echo-reply
    access-list outside_access_in extended deny ip any any log
    access-list outside_cryptomap extended permit ip 192.168.83.0 255.255.255.0 object datacenter-network
    pager lines 24
    logging enable
    logging asdm informational
    mtu inside 1500
    mtu outside 1500
    ip local pool vpn_pool 192.168.83.200-192.168.83.254 mask 255.255.255.0
    icmp unreachable rate-limit 1 burst-size 1
    no asdm history enable
    arp timeout 14400
    nat (inside,outside) source dynamic inside-network interface
    nat (inside,outside) source static inside-network inside-network destination static inside-network inside-network no-proxy-arp route-lookup
    nat (inside,outside) source static inside-network inside-network destination static datacenter-network datacenter-network no-proxy-arp route-lookup
    nat (inside,outside) source static NETWORK_OBJ_192.168.83.0_24 NETWORK_OBJ_192.168.83.0_24 destination static datacenter-network pdatacenter-network no-proxy-arp route-lookup
    access-group outside_access_in in interface outside
    route outside 0.0.0.0 0.0.0.0 DEFAULT_GATEWAY 1
    crypto ipsec ikev1 transform-set vpn-transform-set esp-3des esp-sha-hmac
    crypto ipsec ikev1 transform-set vpn-transform-set mode transport
    crypto ipsec ikev1 transform-set L2L_SET esp-aes esp-sha-hmac
    crypto ipsec ikev1 transform-set L2L_SET mode transport
    crypto dynamic-map dyno 10 set ikev1 transform-set vpn-transform-set
    crypto map vpn 1 match address outside_cryptomap
    crypto map vpn 1 set pfs
    crypto map vpn 1 set peer S1.S1.S1.S1
    crypto map vpn 1 set ikev1 transform-set L2L_SET
    crypto map vpn 20 ipsec-isakmp dynamic dyno
    crypto map vpn interface outside
    crypto isakmp nat-traversal 3600
    crypto ikev1 enable outside
    crypto ikev1 policy 10
    authentication pre-share
    encryption 3des
    hash sha
    group 2
    lifetime 86400
    crypto ikev1 policy 20
    authentication pre-share
    encryption aes-256
    hash sha
    group 2
    lifetime 86400
    group-policy GroupPolicy_S1.S1.S1.S1 internal
    group-policy GroupPolicy_S1.S1.S1.S1 attributes
    vpn-tunnel-protocol ikev1
    group-policy remote_vpn_policy internal
    group-policy remote_vpn_policy attributes
    vpn-tunnel-protocol ikev1 l2tp-ipsec
    username artem password 8xs7XK3To4s5WfTvtKAutA== nt-encrypted
    username admin password rqiFSVJFung3fvFZ encrypted privilege 15
    tunnel-group DefaultRAGroup general-attributes
    address-pool vpn_pool
    default-group-policy remote_vpn_policy
    tunnel-group DefaultRAGroup ipsec-attributes
    ikev1 pre-shared-key *****
    tunnel-group DefaultRAGroup ppp-attributes
    authentication ms-chap-v2
    tunnel-group S1.S1.S1.S1 type ipsec-l2l
    tunnel-group S1.S1.S1.S1 general-attributes
    default-group-policy GroupPolicy_S1.S1.S1.S1
    tunnel-group S1.S1.S1.S1 ipsec-attributes
    ikev1 pre-shared-key *****
    class-map inspection_default
    match default-inspection-traffic
    policy-map type inspect dns preset_dns_map
    parameters
      message-length maximum client auto
      message-length maximum 512
    policy-map global_policy
    class inspection_default
      inspect dns preset_dns_map
      inspect ftp
      inspect h323 h225
      inspect h323 ras
      inspect rsh
      inspect rtsp
      inspect esmtp
      inspect sqlnet
      inspect skinny
      inspect sunrpc
      inspect xdmcp
      inspect sip
      inspect netbios
      inspect tftp
      inspect ip-options
      inspect icmp
    service-policy global_policy global
    prompt hostname context
    no call-home reporting anonymous
    Cryptochecksum:f55f10c19a0848edd2466d08744556eb
    : end

    Thanks for helping me again. I really appreciate.
    I don't hve any NAT-exemptions in Cisco IOS Router. Transform-set I will change soon, but I've tried with tunnel mode and it didn't work.
    Maybe NAT-exemptions is the issue. Can you advice me which exemptions should be in Cisco IOS Router?
    Because on Cisco ASA I guess I have everything.
    Here is show crypto session detail
    router(config)#do show crypto session detail
    Crypto session current status
    Code: C - IKE Configuration mode, D - Dead Peer Detection
    K - Keepalives, N - NAT-traversal, T - cTCP encapsulation
    X - IKE Extended Authentication, F - IKE Fragmentation
    Interface: GigabitEthernet0/0
    Session status: DOWN
    Peer: 198.0.183.225 port 500 fvrf: (none) ivrf: (none)
          Desc: (none)
          Phase1_id: (none)
      IPSEC FLOW: permit ip 192.168.17.0/255.255.255.0 192.168.83.0/255.255.255.0
            Active SAs: 0, origin: crypto map
            Inbound:  #pkts dec'ed 0 drop 0 life (KB/Sec) 0/0
            Outbound: #pkts enc'ed 0 drop 0 life (KB/Sec) 0/0
    Should I see something in crypto isakmp sa?
    pp-border#sh crypto isakmp sa
    IPv4 Crypto ISAKMP SA
    dst             src             state          conn-id status
    IPv6 Crypto ISAKMP SA
    Thanks again for your help.

  • Coherence::net::messaging::ConnectionException: could not establish a connection to one of the following addresses: {10.242.152.242/10.242.152.242:8088}; make sure the "remote-addresses" configuration element contains an address and port of a running TcpA

    Hi
    I have installed coheI have installed coherence server "fmw_12.1.3.0.0_coherence_Disk1_1of1.zip" along with Examples on windows machine and C++ client coherence-cpp-12.1.3.0.0b51709-windows-x86-vs2012.zip on the same machine.
    I have built the "contacts" C++ Example successfully and while I execute this "contacts" using run I am facing TcpAcceptor error.
    On my coherence server the TcpAcceptor is listening on port 8088, so I have modified the extend-cache-config.xml file with values "ip address of my windows machine" and port as "8088".
    All the time I am getting below error,
    coherence::net::messaging::ConnectionException: could not establish a connection to one of the following addresses: {10.242.152.242/10.242.152.242:8088}; make sure the "remote-addresses" configuration element contains an address and port of a running TcpAcceptor
        at class coherence::lang::TypedHandle<class coherence::component::net::extend::PofConnection> __thiscall coherence::component::util::TcpInitiator::openConne
    ction(void)(TcpInitiator.cpp:307)
        at coherence::component::util::TcpInitiator::openConnection
        at coherence::component::util::Initiator::ensureConnection
        at coherence::component::net::extend::RemoteCacheService::openChannel
        at coherence::component::net::extend::RemoteService::doStart
        at coherence::component::net::extend::RemoteService::start
        at coherence::component::util::SafeService::startService
        at coherence::component::util::SafeService::restartService
        at coherence::component::util::SafeService::ensureRunningServiceInternal
        at coherence::component::util::SafeService::start
        at coherence::net::DefaultConfigurableCacheFactory::configureService
        at coherence::net::DefaultConfigurableCacheFactory::ensureService
        at coherence::net::DefaultConfigurableCacheFactory::ensureRemoteCache
        at coherence::net::DefaultConfigurableCacheFactory::configureCache
        at coherence::net::DefaultConfigurableCacheFactory::ensureCache
        at coherence::net::CacheFactory::getCache
        at unsigned __int64 coherence::lang::class_spec<class coherence::lang::Managed<class ContactId>,class coherence::lang::extends<class coherence::lang::Object,class coherence::lang::Void<class coherence::lang::Object> >,class coherence::lang::implements<void,void,void,void,void,void,void,void,void,void,void,void,void,void,void,void> >::sizeOf(bool)
        at _onexit
        at class coherence::util::Hashtable * coherence::lang::factory<class coherence::util::Hashtable>::create(void)
        at class coherence::util::Hashtable * coherence::lang::factory<class coherence::util::Hashtable>::create(void)
        at BaseThreadInitThunk
        at RtlInitializeExceptionChain
        at RtlInitializeExceptionChain
        on thread "main"
    Caused by: coherence::net::messaging::ConnectionException: coherence::component::util::TcpInitiator::TcpConnection@029EAD78{Id=NULL, Open=1, LocalAddress=NULL,
    RemoteAddress=10.242.152.242/10.242.152.242:8088}: socket disconnect
        at class coherence::lang::TypedHandle<class coherence::net::messaging::Response> __thiscall coherence::component::net::extend::AbstractPofRequest::Status::g
    etResponse(void)(AbstractPofRequest.cpp:203)
        at coherence::component::net::extend::AbstractPofRequest::Status::getResponse
        at coherence::component::net::extend::AbstractPofRequest::Status::waitForResponse
        at coherence::component::util::Initiator::openConnection
        at coherence::component::net::extend::PofConnection::open
        at coherence::component::util::TcpInitiator::openConnection
        at coherence::component::util::Initiator::ensureConnection
        at coherence::component::net::extend::RemoteCacheService::openChannel
        at coherence::component::net::extend::RemoteService::doStart
        at coherence::component::net::extend::RemoteService::start
        at coherence::component::util::SafeService::startService
        at coherence::component::util::SafeService::restartService
        at coherence::component::util::SafeService::ensureRunningServiceInternal
        at coherence::component::util::SafeService::start
        at coherence::net::DefaultConfigurableCacheFactory::configureService
        at coherence::net::DefaultConfigurableCacheFactory::ensureService
        at coherence::net::DefaultConfigurableCacheFactory::ensureRemoteCache
        at coherence::net::DefaultConfigurableCacheFactory::configureCache
        at coherence::net::DefaultConfigurableCacheFactory::ensureCache
        at coherence::net::CacheFactory::getCache
        at unsigned __int64 coherence::lang::class_spec<class coherence::lang::Managed<class ContactId>,class coherence::lang::extends<class coherence::lang::Object
    ,class coherence::lang::Void<class coherence::lang::Object> >,class coherence::lang::implements<void,void,void,void,void,void,void,void,void,void,void,void,void
    ,void,void,void> >::sizeOf(bool)
        at _onexit
        at class coherence::util::Hashtable * coherence::lang::factory<class coherence::util::Hashtable>::create(void)
        at class coherence::util::Hashtable * coherence::lang::factory<class coherence::util::Hashtable>::create(void)
        at BaseThreadInitThunk
        at RtlInitializeExceptionChain
        at RtlInitializeExceptionChain
        on thread "main"
    Caused by: coherence::io::IOException: socket disconnect
        at unsigned int __thiscall coherence::net::Socket::readInternal(unsigned char *,unsigned int)(Socket.cpp:333)
        at coherence::net::Socket::readInternal
        at coherence::net::Socket::SocketInput::read
        at coherence::io::BufferedInputStream::fillBuffer
        at coherence::io::BufferedInputStream::read
        at coherence::component::util::TcpInitiator::readMessageLength
        at coherence::component::util::TcpInitiator::TcpConnection::TcpReader::onNotify
        at coherence::component::util::Daemon::run
        at coherence::lang::Thread::run
        on thread "ExtendTcpCacheService:coherence::component::util::TcpInitiator:coherence::component::util::TcpInitiator::TcpConnection::TcpReader"

    We are facing same issue.    Could you please provide us any working .Net sample code for the version 12.1.2.0.
    <ssl>
                  <protocol>Tls</protocol>
                  <local-certificates>
                    <certificate>
                      <url>c:\Cert\</url>
                      <password>password</password>
                      <flags>DefaultKeySet</flags>
                    </certificate>
                  </local-certificates>
                </ssl>
    thanks
    Bala

Maybe you are looking for

  • I cannot view my time line, all I see is the Project library

    Under Project Library I see my Hard Drives and cannot switch back to seeing the time line.   This has to be an easy fix.  Anyone know what I should do? thank you!

  • Unzip error in step 4 of 5. Installation failing

    Hi, I am trying to install EBS R12.1.1 on my Windows XP SP3 machine. I use cygwin instead of MKS toolkit (for obvious reasons). The installation proceeds fine. It installs the DB without any problems and the whole process goes fine until step 4. Here

  • How to hide this table if my record in display table =null?

    i create a list to display record inside the table. If i wanna hide my table in case the list no any record. What statement should i add on? i may using <c:choose> ? <tr> <td colspan="3"> <fieldset> <legend>CSC Listing</legend> <table> <tr> <td colsp

  • Using Flex to call an Enterprise Service in the ES Workplace

    Hi all, I'm trying to build a simple example of calling an Enterprise Service that resides in the ES Workplace and displaying the results in a Flex 3 app.  I am stuck at the authentication piece and am getting a security error from the Flex app indic

  • First Photo Transfer From iPad to PC a FAIL

    WOW...  What a FAIL.  I just moved for the first time to my new iPad 48 .jpg pictures from my camera memory chip.  That went fine.  Next I hooked up the transfer cable to the PC (Windows 7, 64-bit) and transferred the 48 pictures from the iPad to My