Bu çeviri makine öğrenimi kullanılarak oluşturulmuştur ve %100 doğru olmayabilir. İngilizce versiyonu görüntüle

I2CP'ye Genel Bakış

I2P İstemci Protokolü'nün (I2CP) genel bakışı - oturum yönetimi, seçenekler, yük biçimi ve çoklama.

Genel Bakış

I2P İstemci Protokolü (I2CP), ağ üzerinden iletişim kurmak isteyen yönlendirici ile herhangi bir istemci arasında güçlü bir sorumluluk ayrımı sağlar. I2CP, tek bir TCP soketi üzerinden mesaj gönderip alarak güvenli ve eşzamansız mesajlaşmayı mümkün kılar. I2CP ile bir istemci uygulaması, yönlendiriciye kim olduğunu (“hedefi”), hangi anonimlik, güvenilirlik ve gecikme ödünlerini vereceğini ve mesajların nereye gönderileceğini bildirir. Buna karşılık yönlendirici, gelen mesajlar olduğunda bunu istemciye bildirmek ve bazı tünellerin kullanılması için yetkilendirme talep etmek amacıyla I2CP’yi kullanır.

Protokolün kendisi, İstemci SDK’sını sunmak için Java’da uygulanmıştır. Bu SDK, I2CP’nin istemci tarafını uygulayan i2p.jar paketinde sunulur. İstemciler, yönlendiriciyi ve I2CP’nin yönlendirici tarafını içeren router.jar paketine asla erişmek zorunda kalmamalıdır. Java dışı bir istemci, TCP tarzı bağlantılar için akış kütüphanesini de uygulamak zorundadır.

Uygulamalar, istemcilerin herhangi bir şifrelemeyle uğraşmasını gerektirmeyen Simple Anonymous Messaging (SAM) protokolünü kullanarak temel I2CP’yi artı streaming ve datagram kütüphanelerinden yararlanabilir. Ayrıca, istemciler birkaç vekil sunucu türü aracılığıyla ağa erişebilir - HTTP, CONNECT ve SOCKS 4/4a/5. Alternatif olarak, Java istemcileri ministreaming.jar ve streaming.jar içindeki bu kütüphanelere erişebilir. Böylece hem Java hem de Java dışı uygulamalar için birkaç seçenek vardır.

İstemci tarafında uçtan uca şifreleme (verilerin I2CP bağlantısı üzerinden şifrelenmesi), 0.6 sürümünde I2P’de devre dışı bırakıldı ve yönlendiricide uygulanan ElGamal/AES uçtan uca şifreleme mevcut kaldı. İstemci kütüphanelerinin hâlâ uygulaması gereken tek kriptografi, LeaseSet’ler ve Oturum Yapılandırmaları için DSA ortak/özel anahtar imzalama işlemi ile bu anahtarların yönetimidir.

Standart bir I2P kurulumunda, dış Java istemcilerin yerel yönlendiriciyle I2CP üzerinden iletişim kurmak için 7654 numaralı bağlantı noktası kullanılır. Varsayılan olarak, yönlendirici 127.0.0.1 adresine bağlanır. 0.0.0.0 adresine bağlanmak için yönlendiricinin gelişmiş yapılandırma seçeneği olan i2cp.tcp.bindAllInterfaces=true değerini ayarlayıp yönlendiriciyi yeniden başlatın. Yönlendiriciyle aynı JVM içinde bulunan istemciler, mesajları doğrudan bir iç JVM arayüzü üzerinden yönlendiriciye iletir.

Bazı yönlendirici ve istemci uygulamaları, i2cp.SSL=true seçeneğiyle yapılandırıldığı şekilde SSL üzerinden harici bağlantılara da destek verebilir. SSL varsayılan olmasa da, açık İnternet’e maruz kalabilecek tüm trafiğe kesinlikle tavsiye edilir. SSL etkin değilse, yetkilendirme kullanıcı adı/parolası (varsa), Hedef için Özel Anahtar ve İmzalama Özel Anahtarı açık bir şekilde iletilir. Bazı yönlendirici ve istemci uygulamaları aynı zamanda etki alanı soketleri üzerinden harici bağlantılara da destekleyebilir.

I2CP Protokolü Spesifikasyonu

Tam protokol belirtimi için I2CP Spesifikasyon sayfasına bakın.

I2CP Başlatma

Bir istemci yönlendiriciye bağlandığında, önce tek bir protokol sürümü baytı (0x2A) gönderir. Ardından bir GetDate Mesajı gönderir ve SetDate Mesajı yanıtını bekler. Daha sonra oturum yapılandırmasını içeren bir CreateSession Mesajı gönderir. Bundan sonra yönlendiriciden gelen, gelen tünelin oluşturulduğunu belirten bir RequestLeaseSet Mesajı ’nı bekler ve imzalanmış LeaseSet içeren bir CreateLeaseSetMesajı ile yanıt verir. Artık istemci diğer I2P hedeflerinden bağlantıları başlatabilir veya alabilir.

I2CP Seçenekleri

Yönlendirici Tarafı Seçenekler

Aşağıdaki seçenekler geleneksel olarak bir CreateSession Mesajı veya bir ReconfigureSession Mesajı içinde bulunan bir SessionConfig aracılığıyla yönlendiriciye iletilir.

Router-side Options
OptionAs Of ReleaseRecommended ArgumentsAllowable RangeDefaultDescription
clientMessageTimeout8*1000 - 120*100060*1000The timeout (ms) for all sent messages. Unused. See the protocol specification for per-message settings.
crypto.lowTagThreshold0.9.21-12830Minimum number of ElGamal/AES Session Tags before we send more. Recommended: approximately tagsToSend * 2/3
crypto.ratchet.inboundTags0.9.471-?160Inbound tag window for ECIES-X25519-AEAD-Ratchet. Local inbound tagset size. See proposal 144.
crypto.ratchet.outboundTags0.9.471-?160Outbound tag window for ECIES-X25519-AEAD-Ratchet. Advisory to send to the far-end in the options block. See proposal 144.
crypto.tagsToSend0.9.21-12840Number of ElGamal/AES Session Tags to send at a time. For clients with relatively low bandwidth per-client-pair (IRC, some UDP apps), this may be set lower.
explicitPeersnullComma-separated list of Base 64 Hashes of peers to build tunnels through; for debugging only
i2cp.dontPublishLeaseSettrue, falsefalseShould generally be set to true for clients and false for servers
i2cp.fastReceive0.9.4true, falsefalseIf true, the router just sends the MessagePayload instead of sending a MessageStatus and awaiting a ReceiveMessageBegin.
i2cp.leaseSetAuthType0.9.4100-20The type of authentication for encrypted LS2. 0 for no per-client authentication (the default); 1 for DH per-client authentication; 2 for PSK per-client authentication. See proposal 123.
i2cp.leaseSetEncType0.9.384,00-65535,...0The encryption type to be used, as of 0.9.38. Interpreted client-side, but also passed to the router in the SessionConfig, to declare intent and check support. As of 0.9.39, may be comma-separated values for multiple types. See PublicKey in common structures spec for values. See proposals 123, 144, and 145.
i2cp.leaseSetOfflineExpiration0.9.38The expiration of the offline signature, 4 bytes, seconds since the epoch. See proposal 123.
i2cp.leaseSetOfflineSignature0.9.38The base 64 of the offline signature. See proposal 123.
i2cp.leaseSetPrivKey0.9.41A base 64 X25519 private key for the router to use to decrypt the encrypted LS2 locally, only if per-client authentication is enabled. Optionally preceded by the key type and ':'. Only "ECIES_X25519:" is supported, which is the default. See proposal 123. Do not confuse with i2cp.leaseSetPrivateKey which is for the leaseset encryption keys.
i2cp.leaseSetSecret0.9.39""Base 64 encoded UTF-8 secret used to blind the leaseset address. See proposal 123.
i2cp.leaseSetTransientPublicKey0.9.38[type:]b64 The base 64 of the transient private key, prefixed by an optional sig type number or name, default DSA_SHA1. See proposal 123.
i2cp.leaseSetType0.9.381,3,5,71-2551The type of leaseset to be sent in the CreateLeaseSet2 Message. Interpreted client-side, but also passed to the router in the SessionConfig, to declare intent and check support. See proposal 123.
i2cp.messageReliabilityBestEffort, NoneBestEffortGuaranteed is disabled; None implemented in 0.8.1; the streaming lib default is None as of 0.8.1, the client side default is None as of 0.9.4
i2cp.password0.8.2stringFor authorization, if required by the router. If the client is running in the same JVM as a router, this option is not required. Warning - username and password are sent in the clear to the router, unless using SSL (i2cp.SSL=true). Authorization is only recommended when using SSL.
i2cp.username0.8.2string
inbound.allowZeroHoptrue, falsetrueIf incoming zero hop tunnel is allowed
outbound.allowZeroHoptrue, falsetrueIf outgoing zero hop tunnel is allowed
inbound.backupQuantitynumber from 0 to 3No limit0Number of redundant fail-over for tunnels in
outbound.backupQuantitynumber from 0 to 3No limit0Number of redundant fail-over for tunnels out
inbound.IPRestrictionnumber from 0 to 40 to 42Number of IP bytes to match to determine if two routers should not be in the same tunnel. 0 to disable.
outbound.IPRestrictionnumber from 0 to 40 to 42Number of IP bytes to match to determine if two routers should not be in the same tunnel. 0 to disable.
inbound.lengthnumber from 0 to 30 to 73Length of tunnels in
outbound.lengthnumber from 0 to 30 to 73Length of tunnels out
inbound.lengthVariancenumber from -1 to 2-7 to 70Random amount to add or subtract to the length of tunnels in. A positive number x means add a random amount from 0 to x inclusive. A negative number -x means add a random amount from -x to x inclusive. The router will limit the total length of the tunnel to 0 to 7 inclusive. The default variance was 1 prior to release 0.7.6.
outbound.lengthVariancenumber from -1 to 2-7 to 70Random amount to add or subtract to the length of tunnels out. A positive number x means add a random amount from 0 to x inclusive. A negative number -x means add a random amount from -x to x inclusive. The router will limit the total length of the tunnel to 0 to 7 inclusive. The default variance was 1 prior to release 0.7.6.
inbound.nicknamestringName of tunnel - generally used in routerconsole, which will use the first few characters of the Base64 hash of the destination by default.
outbound.nicknamestringName of tunnel - generally ignored unless inbound.nickname is unset.
outbound.priority0.9.4number from -25 to 25-25 to 250Priority adjustment for outbound messages. Higher is higher priority.
inbound.quantitynumber from 1 to 31 to 162Number of tunnels in. Limit was increased from 6 to 16 in release 0.9; however, numbers higher than 6 are incompatible with older releases.
outbound.quantitynumber from 1 to 3No limit2Number of tunnels out
inbound.randomKey0.9.17Base 64 encoding of 32 random bytesUsed for consistent peer ordering across restarts.
outbound.randomKey0.9.17Base 64 encoding of 32 random bytes
inbound.*Any other options prefixed with "inbound." are stored in the "unknown options" properties of the inbound tunnel pool's settings.
outbound.*Any other options prefixed with "outbound." are stored in the "unknown options" properties of the outbound tunnel pool's settings.
shouldBundleReplyInfo0.9.2true, falsetrueSet to false to disable ever bundling a reply LeaseSet. For clients that do not publish their LeaseSet, this option must be true for any reply to be possible. "true" is also recommended for multihomed servers with long connection times.

Setting to “false” may save significant outbound bandwidth, especially if the client is configured with a large number of inbound tunnels (Leases). If replies are still required, this may shift the bandwidth burden to the far-end client and the floodfill. There are several cases where “false” may be appropriate:

  • Unidirectional communication, no reply required
  • LeaseSet is published and higher reply latency is acceptable
  • LeaseSet is published, client is a “server”, all connections are inbound so the connecting far-end destination obviously has the leaseset already. Connections are either short, or it is acceptable for latency on a long-lived connection to temporarily increase while the other end re-fetches the LeaseSet after expiration. HTTP servers may fit these requirements.
Not: Büyük miktar, uzunluk veya varyans ayarları önemli performans veya güvenilirlik sorunlarına neden olabilir.

Not: 0.7.7 sürümünden itibaren, seçenek adları ve değerleri UTF-8 kodlaması kullanmalıdır. Bu özellik özellikle takma isimler için faydalıdır. Bu sürüm öncesinde, çok baytlı karakterler içeren seçenekler bozuluyordu. Seçenekler bir Mapping içinde kodlandığından, tüm seçenek adları ve değerleri en fazla 255 bayt (karakter değil) ile sınırlıdır.

İstemci tarafı seçenekleri

Aşağıdaki seçenekler istemci tarafında yorumlanır ve I2PClient.createSession() çağrısı aracılığıyla I2PSession’a iletilirse yorumlanır. Akış kütüphanesi bu seçenekleri ayrıca I2CP’ye iletmelidir. Diğer uygulamalar farklı varsayılanlara sahip olabilir.

Client-side Options
OptionAs Of ReleaseRecommended ArgumentsAllowable RangeDefaultDescription
i2cp.closeIdleTime0.7.11800000300000 minimum(ms) Idle time required (default 30 minutes)
i2cp.closeOnIdle0.7.1true, falsefalseClose I2P session when idle
i2cp.encryptLeaseSet0.7.1true, falsefalseEncrypt the lease
i2cp.fastReceive0.9.4true, falsetrueIf true, the router just sends the MessagePayload instead of sending a MessageStatus and awaiting a ReceiveMessageBegin.
i2cp.gzip0.6.5true, falsetrueGzip outbound data
i2cp.leaseSetAuthType0.9.4100-20The type of authentication for encrypted LS2. 0 for no per-client authentication (the default); 1 for DH per-client authentication; 2 for PSK per-client authentication. See proposal 123.
i2cp.leaseSetBlindedType0.9.390-65535See prop. 123The sig type of the blinded key for encrypted LS2. Default depends on the destination sig type. See proposal 123.
i2cp.leaseSetClient.dh.nnn0.9.41b64name:b64pubkeyThe base 64 of the client name (ignored, UI use only), followed by a ':', followed by the base 64 of the public key to use for DH per-client auth. nnn starts with 0. See proposal 123.
i2cp.leaseSetClient.psk.nnn0.9.41b64name:b64privkeyThe base 64 of the client name (ignored, UI use only), followed by a ':', followed by the base 64 of the private key to use for PSK per-client auth. nnn starts with 0. See proposal 123.
i2cp.leaseSetEncType0.9.3800-65535,...0The encryption type to be used, as of 0.9.38. Interpreted client-side, but also passed to the router in the SessionConfig, to declare intent and check support. As of 0.9.39, may be comma-separated values for multiple types. See also i2cp.leaseSetPrivateKey. See PublicKey in common structures spec for values. See proposals 123, 144, and 145.
i2cp.leaseSetKey0.7.1For encrypted leasesets. Base 64 SessionKey (44 characters)
i2cp.leaseSetOption.nnn0.9.66srvKey=srvValueA service record to be placed in the LeaseSet2 options. Example: "_smtp._tcp=1 86400 0 0 25 ...b32.i2p". nnn starts with 0. See proposal 167.
i2cp.leaseSetPrivateKey0.9.18Base 64 private keys for encryption. Optionally preceded by the encryption type name or number and ':'. For LS1, only one key is supported, and only "0:" or "ELGAMAL_2048:" is supported, which is the default. As of 0.9.39, for LS2, multiple keys may be comma-separated, and each key must be a different encryption type. I2CP will generate the public key from the private key. Use for persistent leaseset keys across restarts. See proposals 123, 144, and 145. See also i2cp.leaseSetEncType. Do not confuse with i2cp.leaseSetPrivKey which is for encrypted LS2.
i2cp.leaseSetSecret0.9.39""Base 64 encoded UTF-8 secret used to blind the leaseset address. See proposal 123.
i2cp.leaseSetSigningPrivateKey0.9.18Base 64 private key for signatures. Optionally preceded by the key type and ':'. DSA_SHA1 is the default. Key type must match the signature type in the destination. I2CP will generate the public key from the private key. Use for persistent leaseset keys across restarts.
i2cp.leaseSetType0.9.381,3,5,71-2551The type of leaseset to be sent in the CreateLeaseSet2 Message. Interpreted client-side, but also passed to the router in the SessionConfig, to declare intent and check support. See proposal 123.
i2cp.messageReliabilityBestEffort, NoneNoneGuaranteed is disabled; None implemented in 0.8.1; None is the default as of 0.9.4
i2cp.reduceIdleTime0.7.11200000300000 minimum(ms) Idle time required (default 20 minutes, minimum 5 minutes)
i2cp.reduceOnIdle0.7.1true, falsefalseReduce tunnel quantity when idle
i2cp.reduceQuantity0.7.111 to 51Tunnel quantity when reduced (applies to both inbound and outbound)
i2cp.SSL0.8.3true, falsefalseConnect to the router using SSL. If the client is running in the same JVM as a router, this option is ignored, and the client connects to that router internally.
i2cp.tcp.host127.0.0.1Router hostname. If the client is running in the same JVM as a router, this option is ignored, and the client connects to that router internally.
i2cp.tcp.port1-655357654Router I2CP port. If the client is running in the same JVM as a router, this option is ignored, and the client connects to that router internally.
Not: Sayılar dahil olmak üzere tüm argümanlar dizelerdir. Doğru/yanlış değerleri büyük/küçük harf duyarlı olmayan dizelerdir. Büyük/küçük harf duyarlı olmayan "true" (doğru) dışında her şey yanlış olarak yorumlanır. Tüm seçenek adları büyük/küçük harfe duyarlıdır.

I2CP Yük Veri Biçimi ve Çoklama

I2CP tarafından işlenen uçtan uca mesajlar (yani bir istemcinin SendMessageMessage içinde gönderdiği ve bir istemcinin MessagePayloadMessage içinde aldığı veri), RFC 1952 tarafından belirtildiği gibi 0x1F 0x8B 0x08 ile başlayan standart 10 baytlık bir gzip başlığıyla sıkıştırılır. 0.7.1 sürümünden itibaren I2P, aynı hedef üzerinde akış ve veriagramları desteklemek ve birden fazla kanal varken veriagramlar kullanarak sorgu/yanıt işleminin güvenilir bir şekilde çalışmasını sağlamak amacıyla gzip başlığının görmezden gelinen bölümlerine protokol, gönderen-port ve alan-port bilgilerini eklemektedir.

gzip işlevi tamamen kapatılamaz, ancak i2cp.gzip=false ayarı gzip çabasını 0’a indirir ve bu da biraz CPU tasarrufu sağlayabilir. Uygulamalar, içeriğin sıkıştırılabilirliği değerlendirilerek mesaj başına veya soket başına farklı gzip çabaları seçebilir. Yükün sıkıştırılamaz olması durumunda bile, API 0.9.57’de (öneri 161) uygulanan hedef dolgusunun sıkıştırılabilirliği, her iki yöndeki akış SYN paketlerinin ve yanıtlanabilir verigramların sıkıştırılması önerilir. Uygulamalar, gzip çabası 0 için bir gzip/gunzip kütüphanesine göre büyük verimlilik kazançları sağlayan basit bir gzip/gunzip işlevi yazmak isteyebilir.

BytesContent
0-2Gzip header 0x1F 0x8B 0x08
3Gzip flags
4-5I2P Source port (Gzip mtime)
6-7I2P Destination port (Gzip mtime)
8Gzip xflags (set to 2 to be indistinguishable from the Java implementation)
9I2P Protocol (6 = Streaming, 17 = Datagram, 18 = Raw Datagrams) (Gzip OS)
Not: I2P protokol numaraları 224-254 deneysel protokoller için ayrılmıştır. I2P protokol numarası 255 gelecekteki genişletmeler için ayrılmıştır.

Veri bütünlüğü, RFC 1952 tarafından belirtildiği gibi standart gzip CRC-32 ile doğrulanır.

Standart IP’den Önemli Farklılıklar

I2CP portları I2P soketleri ve datagramları içindir. Bunlar yerel soketleriniz veya portlarınızla ilgili değildir. I2P, 0.7.1 sürümüne kadar portları ve protokol numaralarını desteklemediği için, geriye dönük uyumluluk açısından portlar ve protokol numaraları standart IP’dekiyle biraz farklıdır:

  • 0 numaralı port geçerlidir ve özel bir anlam taşır.
  • 1-1023 numaralı portlar özel veya ayrıcalıklı değildir.
  • Sunucular varsayılan olarak 0 numaralı portu dinler; bu, “tüm portlar” anlamına gelir.
  • İstemciler varsayılan olarak 0 numaralı porta gönderir; bu, “herhangi bir port” anlamına gelir.
  • İstemciler varsayılan olarak 0 numaralı porttan gönderir; bu, “belirtilmemiş” anlamına gelir.
  • Sunucular, 0 numaralı portta dinleyen bir hizmete ve daha yüksek portlarda dinleyen diğer hizmetlere sahip olabilir. Bu durumda 0 numaralı porttaki hizmet varsayılan olur ve gelen soket veya datagram portu başka bir hizmetle eşleşmiyorsa bu hizmete bağlanılır.
  • Çoğu I2P hedefinde yalnızca bir hizmet çalışır; bu yüzden varsayılanları kullanabilir ve I2CP port yapılandırmasını göz ardı edebilirsiniz.
  • 0 numaralı protokol geçerlidir ve “herhangi bir protokol” anlamına gelir. Ancak bu önerilmez ve büyük olasılıkla çalışmaz. Akış (streaming) için protokol numarasının 6 olarak ayarlanması gerekir.
  • Akış soketleri, iç bir bağlantı kimliği (ID) ile izlenir. Bu yüzden, dest:port:dest:port:protokol’den oluşan 5-linin benzersiz olması gerekmez. Örneğin, iki hedef arasında aynı portlara sahip birden fazla soket olabilir. İstemcilerin giden bir bağlantı için “boş bir port” seçmesi gerekmez.

Gelecek Çalışmalar

  • Mevcut yetkilendirme mekanizması, karmalanmış parolaları kullanacak şekilde değiştirilebilir.
  • Kiralık Seti Oluştur (Create Lease Set) mesajına İmzalama Özel Anahtarları dahil edilmiştir, ancak bu gerekli değildir. İptal işlemi henüz uygulanmamıştır. Rastgele verilerle değiştirilmeli veya kaldırılmalıdır.
  • Bazı iyileştirmeler daha önce tanımlanmış ancak uygulanmamış mesajları kullanabilir.

Was this page helpful?